Robert Meek wrote:
> 1. I have an application which although it's mainform shows a
> close button, I have a Boolean var being read in the OnCloseQuery
> procedure disallowing close unless set to TRUE via the application's
> main menu Exit command.  This works fine, however I also want the app
> to close normally if running when Windows itself is shut down.  Is
> there anyway to do this? 

Robert,

You could handle the WMQueryEndSession message, e.g.


procedure TFormMain.WMQueryEndSession (var Msg: TWMQueryEndSession);
begin
  StopProgram;    // do whatever to allow Close
  Msg.Result := 1;
end;

David
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to