• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

Detect no user input

Dear Gurus,
I want to detect when there has been no user input (mouse or keyboard) for a certain amount of time, even if my VB app is not the active app.
Like how windows activates a screen saver.
Thankyou.
0
jasonbb
Asked:
jasonbb
1 Solution
 
NARobertsCommented:
You could use a timer that checks a variable to see if its on or off.  Then use keypress to reset the variable to off or on or whatever on any keypress.  Then setup a hold area for your mouse x,y coords.  On the timer expire check current mouse x,y against the held ones. At least conceptually.   Not sure about all the code but is should be fairly easy.  
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Use the GetLastInputInfo() API.

See the example posted by zzzzzooc here:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21631921.html
0
 
nffvrxqgrcfqvvcCommented:
I would prefer the above mentioned by Idle_Mind, however there is another way but you should only use it as long as its for personal use and not for deployment.
You can find my example here:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64388&lngWId=1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now