?
Solved

Detect no user input

Posted on 2006-03-22
3
Medium Priority
?
327 Views
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.
Thankyou.
0
Comment
Question by:jasonbb
3 Comments
 
LVL 3

Expert Comment

by:NARoberts
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.  
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 16257782
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
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:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64388&lngWId=1
0

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