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?