Delphi-Quellcode:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var msgresult : integer;
begin
msgresult := 7;
if levelchanged then
msgresult := application.MessageBox('Wirklich schliessen?','Beenden',mb_yesno);
// no: 7 yes: 6
if msgresult = 6 then
begin
Action := caNone;
end;
end;
Edit: Delphi-tags das Luckie nich motzt *gg*