unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure winexit(var msg:Tmessage);message WM_QUERYENDSESSION;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
procedure TForm1.winexit(var msg: Tmessage);
begin
// quit your program here such as unregister your process
//then
msg.Result:=true;
end;
end.