Run procedure on application shut down

svjensen

Registered User.
Local time
Today, 15:18
Joined
May 6, 2010
Messages
37
I need to run a clean up procedure when the user closes the application.
I have created a toolbar control, which allows the user to close the application, and have the procedure tied up to this. This works fine.

But I have been unable to make it run if the user chooses to close the application by clicking the 'Close' button in the upper right corner.

My question is if there is an 'application_close' event (or similar) which I can use to run my clean up code, or if I (as an alternatively solution) can disable the 'Close' button?

/Soren
 
What is there to clean up when your application is closed? If you're talking about updating a table before the app is closed then this is reasonable.

One way of getting running the code before the app closes is to use the switchboard form if it remains open throughout the entire session. If you don't have a switchboard then you need to create a form that remains open and hidden when the app loads. Then run the code in the Unload event of that form.
 
That is what I am looking at (cleaning up prior to shut down) :-)

I will give the form unload event a go.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom