我的源码:
//响应关机消息
procedure WMQueryEndSession(var Mes: TMessage);
begin
if (Mes.Msg = WM_QUERYENDSESSION) or (Mes.Msg = WM_DESTROY) or
(Mes.Msg = WM_CLOSE) or (Mes.Msg = WM_QUIT) then
begin
// inherited ;
showmessage('要关机了!');
mes.result:=1;
halt(0);
end;
end;