you do get the endsession
trap it by
type TForm1 = class(TForm)
*************
procedure WndProc(var Msg: TMessage); override;
private
********
public
*******
end;
procedure TForm1.WndProc(var Msg: TMessage);
//traps incoming messages to check for close events
begin
if Msg.Msg=WM_QueryEndSession
begin
>>>>Dosomethinghere
inherited WndProc(Msg);
end
else
inherited WndProc(Msg);
end;
Main Topics
Browse All Topics





by: atul_parmarPosted on 2006-06-26 at 00:09:09ID: 16981790
Hi,
When user logs off you will receive WM_QUERYENDSESSION message. But I think you can not cought it while IDE is running (the reason might be that the IDE will receive the same message and terminate its process or debugger). To test it run the application outside the IDE.
the message should look like
procedure OnLogOff(var Msg : TMessage); message WM_QUERYENDSESSION;
procedure TForm1.OnLogOff(var Msg: TMessage);
begin
ShowMessage('End Session');
Msg.Result := 0; // This will stop the log off
end;