Link to home
Start Free TrialLog in
Avatar of jdrescher
jdrescher

asked on

Detect idle keyboard and mouse in MFC.

I need a simple way to detect that the user has been idle(no keyboard and mouse activity) for a period of time in my application. I have several windows, dialog boxes and active X controls in my application so I don't think it is possible to just capture these messages in the main window and reset some timer. I'm thinking of implementing an application wide hook. Is this the best approach? Anyone got any source code for this?
Avatar of jkr
jkr
Flag of Germany image

Check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsj00/html/cpp0200.asp - it has all the info that you need, including sample code. (Credits to robpitt for mentioning this in another thread)
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdrescher
jdrescher

ASKER

Thanks, Dan. This exactly what I wanted..

John