Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

Please let me know if they are any APIs or any other methods by which i can check if the system has entered idle state or not?
Posted

 
Share this answer
 
Comments
Wayne Gaylard 10-Jun-11 5:29am    
That's cool!
Kim Togo 10-Jun-11 7:24am    
Thanks
yesotaso 10-Jun-11 7:23am    
Good one, but something bothers me. If powermode changes and PC goes to hibernate what good do knowing that? :P
Kim Togo 10-Jun-11 7:29am    
I know... I haven tried it out. But in the documentation from MSDN on PowerModes.
It says:

Suspend - The operating system is about to be suspended.

How much reaction time there, is do not know.
IFAIK, no: think about it - if the OS is in the idle state, how is the code you are using to check running?
 
Share this answer
 
I am not quite sure what you want to do with idleness or what you mean by idle but user32.dll exports GetLastInputInfo[^] which you can check timely fashion to decide whether PC is idle or not. For instance, "2 minutes past since last user input, so I assume user is away from keyboard and this code will do blah blah".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900