Detect no user input

Posted on 2006-03-22
Medium Priority
Last Modified: 2010-05-01
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.
Question by:jasonbb

Expert Comment

ID: 16257062
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.  
LVL 86

Accepted Solution

Mike Tomlinson earned 1000 total points
ID: 16257782
Use the GetLastInputInfo() API.

See the example posted by zzzzzooc here:
LVL 29

Expert Comment

ID: 16263381
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:

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question