Detect Win95/Win98 idle state

How do my program detects if win95/win98 is in idle state/screen saver is running/power saving mode ?

Thank you.
Who is Participating?
robpittConnect With a Mentor Commented:
Sorry jhance but I think you're wrong (or your reading the Q. differently than me).
WM_ENTERIDLE is an application specific idle - this can still happen whilst the user is working in another program doing a very important task.

Alas theres no single ComputerIsIdleNow() function (that I know of) however the following functions may help:
SystemParametersInfo(), GetLastInputInfo()

In particular see:

A alternative if you know DirectX is to use DirectInput and register for keyboard/mouse event notification - that way you can track when the user last did anything.

See the SDK docs on WM_ENTERIDLE.  

Have your app process the WM_ENTERIDLE message.  When it comes, the system is idling and you can do whatever...
Yes, you are right, I misinterpreted this question.  I see now that the user was indeed asking about Windows in general and not his app.

On place to look is...

Look at "SystemParametersInfo" the call supports parameters such as...

Also you could consider running a tread at low priority (see SetThreadPriority), and trying to figure out if you are getting the lions share of the CPU.

In general good luck - none of this stuff is going to work reliably for you. :-(
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.