close delphi application if not in use for long

Posted by Sunil on May 27, 2001

How do I close a delphi exe if it is not in use for long?

Re: Jean Claude Servaye on May 27, 2001

Place a timer with for exemple 10 seconds timeout on the main form.

On the OnTimer event increment a counter by 1.
If the counter >= 6 then close the application. (for 1 minute inactivity closing)

On the Mouse and keyboard Events, reset the counter to 0.