Here it is, the way that I use it. It puts the monitors on standby by hitting Win+M:
#m:: ; Win+M hotkey that turns off the monitor.Don't ask me for a line by line explanation more than what's already annotated in the script itself; I have no idea.
Sleep 1000 ; Give user a chance to release keys (in case their release would wake up the monitor again).
; Turn Monitor Off:
SendMessage, 0x112, 0xF170, 2,, Program Manager ; 0x112 is WM_SYSCOMMAND, 0xF170 is SC_MONITORPOWER.
; Note for the above: Use -1 in place of 2 to turn the monitor on.
; Use 1 in place of 2 to activate the monitor's low-power mode.
return
I can't find the original Autohotkey forum post in which I found this specific script, but this forum post has more info.
p.s. - for those of you not in the know, Autohotkey is an extremely versatile program that lets you write scripts as simple as automating windows tasks (like moving a mouse, or opening a folder with a keystroke), to writing full on programs and mods.
This is great, thanks.
ReplyDeleteWorks perfectly in Win2003.
This is the forum post where you got the script, and there is more information there on how it works etc.
ReplyDeletehttp://www.autohotkey.com/forum/topic2142-15.html&sid=03353c828374aac9dc8e1682c9ebe1e7
Awesome! Works perfect
ReplyDeleteThis is what, I need!
First time known about AHK it's interesting-Thanks for that too.
Thank you.
ReplyDeleteI set it to Win+Z.
You can also put the ".ahk" file in the startup folder and have it run every time you start the PC (it will wait for that key combination), and you can also add "#NotrayIcon" to the script, so that it doesn't take up any space in the system tray.
PS: Using "1" instead of "2" doesn't do anything on Windows 10. At least not on my machine.