答非所问。看我的:
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
; Dialogs;
type
; TForm1 = class(TForm)
; private
; ; { Private declarations }
; public
; ; procedure WMEndSession(var msg:TWMEndSession);
; ; ;message wm_EndSession;
; end;
var
; Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.WMEndSession(var msg: TWMEndSession);
begin
; if msg.EndSession then
; begin
; ;showmessage('要关机了,先做点什么。。。');
; //...
; end;
; inherited;
end;
end.