Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a systems busy status. 1

Status
Not open for further replies.

PM2000

Programmer
Aug 18, 2000
42
BM
Hi,

I am writing an app that needs to know if the user has not been using the PC for a certain length of time. When the user has not used the PC for 5 minutes, I want the app to show busy, kind of like what MSN messenger does.

I am unable to find where Windows XP exposes this system value. Has anyone ever written anything like this?

Thanks in advance.

Peter
 
You can start a timer (use the one from the Threading namespace -- the others are tied to the Windows message pump and won't reliably raise events for you) to notify you when your time of interest has passed. The trick is to know when to start it, and when to stop it.

You can start it by listening for the Application.Idle event. It gets raised when the app is about to enter the idle state.

You would stop the timer (or maybe restart it..???) by adding a handler to the Application.MessageLoop. If you see any keyboard events or mouseclicks (mousemoves don't count) you would know the user is interacting with your app in some way, and you'd restart the timer.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top