Sign in to follow this  
Followers 0
laurin1

Windows Idle Detection

11 posts in this topic

Is it possible to do this? I'd like a script to do something once Windows is goes from "idle" to active.


Keith Davis

MCSA, ZCE, A+, N+

http://www.laurinkeithdavis.com

Share this post


Link to post
Share on other sites



Is it possible to do this? I'd like a script to do something once Windows is goes from "idle" to active.

Make it detect if the screensaver is active. I am sure there is a way to run a program when screensaver is active.

Share this post


Link to post
Share on other sites

Make it detect if the screensaver is active. I am sure there is a way to run a program when screensaver is active.

Good idea. I bet I can do that.


Keith Davis

MCSA, ZCE, A+, N+

http://www.laurinkeithdavis.com

Share this post


Link to post
Share on other sites

The screensaver is always a process name <somthing>.scr

--> So if you know which screesaver is enabled you just have to look for this process

The current enabled screensaver can be looked up under

HKCU\Control Panel\Desktop\SCRNSAVE.EXE in the registry

ProcessWait("logon.scr") ;Pauses script execution until a given process exists.

Share this post


Link to post
Share on other sites

What if the user dosen't use a screen saver though?

Share this post


Link to post
Share on other sites

Just check the cpu usage of System Idle Process, If it is above 90% the system is probably idle.

I use Psalty's ProcessListProperties UDF to do this:

http://www.autoitscript.com/forum/index.ph...mp;#entry409276

Ok, but that won't work for this purpose, because I have processes running at times that will push the idle below 90%. How does MS do it?


Keith Davis

MCSA, ZCE, A+, N+

http://www.laurinkeithdavis.com

Share this post


Link to post
Share on other sites

If you have processes taking more than 10% cpu then how is it idle?

Share this post


Link to post
Share on other sites

If you have processes taking more than 10% cpu then how is it idle?

I mean idle in the sense that a user is not on it. My screen saver doesn't stop working because these processes start. It only stops when the keyboard or mouse are used.


Keith Davis

MCSA, ZCE, A+, N+

http://www.laurinkeithdavis.com

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  
Followers 0