VCL EndSession Fix

Usually VCL-based applications would prevent system shutdown / user logoff. This code is supposed to fix that.


procedure TMain.WMQEndSession(var Msg: TWMQueryEndSession);
begin
//WriteLn(Output, 'TMain.WMQEndSession', ' ', Msg.Result);
// Msg.Result := 1;
//Flush(Output);
Finalise;
Halt;
// PostMessage(Handle, WM_DESTROY, 0, 0);
end;

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>