首页 > 代码库 > vb6 关闭显示器

vb6 关闭显示器

Option ExplicitPrivate Const WM_SYSCOMMAND As Long = &H112Private Const SC_MONITORPOWER As Long = &HF170&Private Const HWND_BROADCAST = &HFFFF&Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _     ByVal hWnd As Long, _     ByVal wMsg As Long, _     ByVal wParam As Long, _     ByRef lParam As Any) As Long     Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" ( _    ByVal hWnd As Long, _    ByVal wMsg As Long, _    ByVal wParam As Long, _    ByVal lParam As Long) As LongPrivate Sub Form_Load()    PostMessage HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 2&End Sub

 

vb6 关闭显示器