Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Turn off monitor and block keyboard & mouse

$
0
0
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:
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?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>