Solved

Detect Win95/Win98 idle state

Posted on 2002-04-02
4
376 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 50 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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