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

Application terminating??? 1

Status
Not open for further replies.

BobbaFet

Programmer
Feb 25, 2001
903
NL
Hi all,

How can I detect when application is about to be
terminated? I need to know this so I can still
write the settings to my ini.

Thanx allot,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
 
You could use the onClose event of the main form. This is trigered no matter which way you try to close the form (Alt=F4 etc)

EG

Code:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if MessageDlg('Close application ?', mtConfirmation,
    [mbYes, mbNo], 0) = mrYes then
    Action := caFree
  else
    Action := caNone;
end;

X-)

Billy H

bhogar@acxiom.co.uk
 
Thanx allot, Billy H.

Works like a charm. Such a simple solution ;-)
I always thought that when the application was
terminated, the form would just be freed.

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top