Solved

Detect Win95/Win98 idle state

Posted on 2002-04-02
4
344 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now