?
Solved

Detect Win95/Win98 idle state

Posted on 2002-04-02
4
Medium Priority
?
428 Views
Last Modified: 2013-12-03
How do my program detects if win95/win98 is in idle state/screen saver is running/power saving mode ?

Thank you.
0
Comment
Question by:kctan100
  • 2
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6915320
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...
0
 
LVL 5

Accepted Solution

by:
robpitt earned 200 total points
ID: 6915955
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:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsj00/html/cpp0200.asp


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.

0
 
LVL 32

Expert Comment

by:jhance
ID: 6916129
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.

0
 
LVL 3

Expert Comment

by:GGRUNDY
ID: 6916452
On place to look is...

Look at "SystemParametersInfo" the call supports parameters such as...
SPI_GETSCREENSAVERRUNNING
SPI_GETLOWPOWERACTIVE
SPI_GETPOWEROFFACTIVE

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. :-(
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question