Call screen protection

zhaozj2021-02-16  39

Want to call the system screen protection, mainly to send a WM_SYSCOMMAND message.

Private Declare Function SendMessage Lib "User32" Alias ​​"SendMessagea" (Byval Hwnd As Int32, Byval WMSG AS INT32, BYVAL WPARAM

AS INT32, BYVAL LPARAM AS INT32) AS INT32 Private const hwnd_broadcast = & hffff & private const wm_syscommand = & h112 private const sc_screensave = & hf140 &

Private sub button1_click (Byval e as system.EventArgs) Handles Button1.Click SendMessage (hwnd_broadcast, wm_syscommand, sc_screensave, 0) End Sub

转载请注明原文地址:https://www.9cbs.com/read-27505.html

New Post(0)