jingtao (2000-5-29 23:35:36) <br>------------------------------------<br>unit Unit1; <br>interfaceuses <br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, <br>Dialogs; <br>type <br> TForm1 = class(TForm) <br> procedure FormCreate(Sender: TObject); private <br> { Private declarations } <br> procedure winexit(var msg:Tmessage);message WM_QUERYENDSESSION; <br> public <br> { Public declarations } <br> end; <br>var Form1: TForm1; <br>implementation <br>{$R *.DFM} <br>procedure TForm1.FormCreate(Sender: TObject);beginend; <br><br>procedure TForm1.winexit(var msg: Tmessage); <br>begin <br>showmessage('关机了!'); <br>end; <br> <br>