Jump to content
Sign in to follow this  

Detecting If Screensaver Active

Recommended Posts


Is it possible to detect if the screensaver has activated ?

For the avoidance of doubt, I'm not writing my own screensaver and I know there are lots of example posts for that already.

Basically, I'd like to have a script running silently in the background and as soon as the screensaver kicks-in, it runs a cpu-intensive simulation I'm working on then automatically ceases when the user logs back in.



Share this post

Link to post
Share on other sites

i'm not very keen in process-detection, but as far as i know you just have to know the processname and check if it is active

maybe you should consider using 2 scripts (1 for the detection the other for your cpu-consuming stuff) if you do the process-stuff i can help you with the rest

maybe you can find the process in the registry

the process should be scrnsave.exe, so the code might look like

while 1
while not processexists ("SCRNSAVE.EXE")
sleep (10)
if processexists ("SCRNSAVE.EXE") then run ("other prog")
while processexists ("SCRNSAVE.EXE")
sleep (10)
if not processexists ("SCRNSAVE.EXE") then send ("!a")

this was the code for the frist prog


hotkeyset ("!a", "stop")
;your code here - maybe store your line somewhere and make a reentry-point

func stop()

this could do the job - maybe give it a try

Share this post

Link to post
Share on other sites

I personally would do it like this:

Main Screensaver detector:

while 1
   ProcessWait ("SCRNSAVE.EXE")
   AutoItWinSetTitle ( "SSC_RESUME_10222948377793847" )
   ProcessWaitClose ("SCRNSAVE.EXE")
   AutoItWinSetTitle ( "SSC" )
   Send ("!^#a")

The simulator code: (otherprog.exe)

HotKeySet("!^#a", "_ssc_pause")


Func _ssc_pause()

The otherprog.exe will pause it's script's execution when the screensaver comes off then resume at the point it paused when the screensaver appears again.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...