1
votes

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.

1
I'm afraid there's no such event; is there an event that fires when a process is launched?John Dvorak
How about activating your own "screensaver" by monitoring keyboard/mouse activity + checking which window is open and blanking your screen (nircmd.exe" monitor off) through AHK when YOU want it?Robert Ilbrink

1 Answers

1
votes

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).