Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Public Enum MonitorState
MonitorOn = -1
MonitorOff = 2
MonitorStandby = 1
End Enum
Public Sub SetMonitorState(frmForm As Form, eState As MonitorState)
Dim lngResult As Long
lngResult = SendMessage(frmForm.hwnd, &H112, &HF170, eState)
End Sub