同意楼上意见
unit TesteandoEsta;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, WinTypes, WinProcs, Menus;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure WMQueryEndSession (var Message: TMessage); message WM_QUERYENDSESSION ;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMQueryEndSession (var Message: TMessage);
var
Handled : Boolean;
begin
{ 接收到消息时的通知}
if messagedlg('shutdown?',mtconfirmation,mbyesnocancel,0)= mryes then
Handled:=true
else
Handled:=false;
end;
end.