Guest User

Untitled

a guest
Jun 25th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
  2. begin
  3. inherited; { let the inherited message handler respond first }
  4. {--------------------------------------------------------------------}
  5. { at this point, you can either prevent windows from closing... }
  6. { Message.Result:=0; }
  7. {---------------------------or---------------------------------------}
  8. { just call the same cleanup procedure that you call in FormClose... }
  9. MyCleanUpProcedure;
  10. {--------------------------------------------------------------------}
  11. end;
  12.  
  13. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  14. begin
  15. MyCleanUpProcedure;
  16. end;
  17.  
  18. procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
  19. begin
  20. MyCleanUpProcedure;
  21. inherited;
  22. end;
  23.  
  24. procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
  25. begin
  26. MyCleanUpProcedure;
  27. Message.Result:=1; // tell Windows it is OK to shut down
  28. end;
  29.  
  30. procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
  31. begin
  32. MyCleanUpProcedure;
  33. Message.Result:=1; {Signal that it is OK to shut down}
  34. inherited; { let the inherited message handler respond }
  35. end;
Add Comment
Please, Sign In to add comment