#NoTrayIcon Global Const $lciWM_SYSCommand = 274 Global Const $lciSC_MonitorPower = 61808 Global Const $lciPower_Off = 2 Global Const $lciPower_On = -1 Global $MonitorIsOff = False Global $Swith = False HotKeySet("+!^{PAUSE}", "_Monitor_SWITH") HotKeySet("+!^{Esc}", "_Quit") MsgBox(64, "Monitor On/Off", "Press Ctrl+Alt+Shift+Pause to turn off/on the monitor." & @LF & _ "Press Ctrl+Alt+Shift+Esc to turn on the monitor and exit program.") While 1 Sleep(10) WEnd Func _Monitor_SWITH() If $Swith Then _Monitor_ON $Swith=False Else _Monitor_OFF $Swith=True EndIf EndFunc Func _Monitor_ON() $MonitorIsOff = False Local $Progman_hwnd = WinGetHandle('[CLASS:Progman]') DllCall('user32.dll', 'int', 'SendMessage', _ 'hwnd', $Progman_hwnd, _ 'int', $lciWM_SYSCommand, _ 'int', $lciSC_MonitorPower, _ 'int', $lciPower_On) EndFunc Func _Monitor_OFF() $MonitorIsOff = True Local $Progman_hwnd = WinGetHandle('[CLASS:Progman]') While $MonitorIsOff = True DllCall('user32.dll', 'int', 'SendMessage', _ 'hwnd', $Progman_hwnd, _ 'int', $lciWM_SYSCommand, _ 'int', $lciSC_MonitorPower, _ 'int', $lciPower_Off) |