Solved

Detect Win95/Win98 idle state

Posted on 2002-04-02
4
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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