I'm currently making program which run when windows start and stay in the background. This program will act as a "screen saver". It'll run another program if users don't move their mouse or press any key for certain amount of time. The problem is: how can I detect that the mouse isn't moving and the keyboard isn't pressed at X time (my program is inactive but still run at background) ??? I need to see working program or component.