If you need to prevent the user to close the appl. from the close-button in the
form, then you can use Joe F, Darley's way to do so. But you can
also add this code to prevent [ALT]+[F4] and by right-clik on the appl. in the
programme-bar.
1 2 private3 { Private declarations }4 OkToClose: Boolean;
5 6 {In the forms OnCloseQuery event:}7 procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
8 begin9 CanClose := OkToClose;
10 end;
11 12 {And in your own closebutton: ( if you want to have one )}13 procedure TForm1.CloseProgrammeClick(Sender: TObject);
14 begin15 OkToClose := True;
16 Close;
17 end;
This way you cannot close the appl. other than if you let the user by your own
close-button.
Well... There is one way to close it... You can close the appl. by press
[Ctrl]+[Alt]+[Del] and then close it in progresses or in the Job-list
for programmes...