If you want the timeout to happen after a period of days, you need to setup a counter and store this to the registry, cfg or any file, also store the first run date. Then decrement the counter every time the program runs and the date is different to that stored.
Eventually the counter will get to zero and you can terminate the application (with a suitable warning).
Note This is a simple approach and could easily be 'hacked' I use a more complex 'two tier' version of this for my apps, a date file and a registry entry which must be in sync, its still not perfect but better.
Use the TTimer as Vintagewine suggests but get it to decrement a global integer, Use the Form's onkeypress and onmouse move events to reset the global to the start value.
Start the Value at e.g 30,000 in onactivate
and set the time to a 1000 mS inteval and decrement and check the value, if it gets to zero terminate.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.