I'm trying to writing a script which should function like:
Press a hotkey, monitor is turned off and keyboard/mouse input is blocked (except the hotkey);
Press the hotkey again, monitor is turned on and blocking is removed.
For turning off monitor, I use function like:
and for keyboard & mouse blocking, I tried _BlockInputEx().
However, the keyboard and mouse can be blocked but the monitor cannot stay turned-off when keyboard or mouse is touched. So, any solution?
Press a hotkey, monitor is turned off and keyboard/mouse input is blocked (except the hotkey);
Press the hotkey again, monitor is turned on and blocking is removed.
For turning off monitor, I use function like:
AutoIt Code
Func _Monitor_OFF() Local $Progman_hwnd = WinGetHandle('[CLASS:Progman]') DllCall('user32.dll', 'int', 'SendMessage', _ 'hwnd', $Progman_hwnd, _ 'int', $WM_SYSCmd, _ 'int', $SC_MonitorPower, _ 'int', $Power_Off) EndFunc
and for keyboard & mouse blocking, I tried _BlockInputEx().
However, the keyboard and mouse can be blocked but the monitor cannot stay turned-off when keyboard or mouse is touched. So, any solution?