Perturbatio: Good luck, that was written in Delphi3 but should be OK. You need to include ComObj in Uses (if it's still called that) also FormClose is a global Boolean variable for the form that get's set to true on FormCloseQuery, thus when Application.ProcessMessages is called, it can detect if the user has closed the app. You could enhance this code to have a starting value so that if you shut your PC off one day, you can continue from where you left off the next day :-)