uses
Windows, Messages,.......
type
TForm1 = class(TForm)
private
procedure WMQueryEndSession(var Msg: TWMQueryEndSession); message WM_QUERYENDSESSION;
var
Form1: TForm1;
implementation
procedure TForm1.WMQueryEndSession(var Msg: TWMQueryEndSession);
begin
Msg.result := 1; end;
begin
end.