(声明:魏滔序原创,转贴请注明出处。)
Private Declare Function SendScreenMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const MONITOR_ON = -1&
Private Const MONITOR_LOWPOWER = 1&
Private Const MONITOR_OFF = 2&
Private Const SC_MONITORPOWER = &HF170&
Private Const WM_SYSCOMMAND = &H112
'关闭
If IsNT Then
Call SendScreenMessage(frmWizard.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal MONITOR_LOWPOWER)
Else
Call SendScreenMessage(frmWizard.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 0)
End If
'打开
Call SendScreenMessage(frmWizard.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal MONITOR_ON)
用API关闭或打开显示器
最新推荐文章于 2022-10-02 20:09:46 发布