Reputation: 37
Does Windows send any sort of message or command that can be interpreted by AutoHotKey to run a particular script AS the screensaver is about to activate? Example: my DVR software freezes/locks up my computer if it runs while the screensaver is active. I would like for AHK to close that window when the screensaver turns on, as this is controlled by Group Policy and not me locally.
I know I could create an AHK script that closes the window after 9 min of inactivity, but I would like to link it to the Windows activation of the screensaver if possible. Please advise! I have checked thru Google, SO, and the AHK docs. Thanks.
Upvotes: 1
Views: 2757
Reputation: 7953
If you want to move your mouse 1 pixel back/forth you can use:
SetTimer, MoveMouse, 60000 ; Move mouse every 60 seconds
MoveMouse:
MouseMove, 1, 0, 1, R ;Move the mouse one pixel to the right
Sleep, 50 ; Wait 50 ms. Not realy required, but makes the move visible
MouseMove, -1, 0, 1, R ;Move the mouse back one pixel
return
This will circumvent the system / group policy defined screensaver and allow you to define when the screensaver will kick-in. Moving the mouse 1 pixel back / forth is enough to stop the screensaver and is hardly noticeable. You can stop the timer at any time with the
SetTimer, MoveMouse, Off
Command (I think that any running timers are not affected by setting this to Off).
Upvotes: 1