0

Let's say I want my program to do something after some inactivity. For example let's say that the user of my program won't press any keys / or move the mouse for X seconds, then after these X seconds it'll show a MSGBox, "you were away for X seconds".

I think it'll have to detect both mouse & keyboard on any program.. but how, is there any fast way to do that?

Ydhem
  • 928
  • 2
  • 14
  • 36

2 Answers2

2

Simplest google search brought up this:

http://dataerror.blogspot.co.il/2005/02/detect-windows-idle-time.html Should work

Moka
  • 262
  • 1
  • 9
  • 1
    Solved I found that too : http://www.codeproject.com/Articles/9104/How-to-check-for-user-inactivity-with-and-without Thank you! – Ydhem Dec 16 '12 at 15:55
0

Use Timer Elapsed

Define a public timer, keep it running, and reset it on form events or control events like MouseMove, KeyPress, etc

Alaa Alweish
  • 8,904
  • 16
  • 57
  • 84