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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DETECT INACTIVITY

Status
Not open for further replies.

hbez

Instructor
Mar 25, 2003
49
ZA
Could someone please show me how to close my application if there has been no user input for a specified period of time? I want my program to terminate if the user did not click a key for say 10 minutes. I'm guessing I will need to use a TTimer so I can specify the time, together with Application.OnIdle in some way?

Hannes
 
You can use a TTimer, Set its .interval and .enable it at start-up.
Then reset its '.Enabled' property, when you get an OnKey or OnMouse type event, this will reset the timer to its Interval Property.
If the timer event occurs (its timed out) call 'Close' or Application.terminate. If you application is fairy simple Close will probably work fine.



Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
Thank you Steve, why does one always want to choose the complicated way of doing things! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top