Hello,

It's the first time that I use Lazarus with Windows, and almost 10 years
since I last developed to Windows.

I'm trying to capture the windows message WM_QUERYENDSESSION (that exists
on JwaWinUser).

I did something like this:

TForm1 = class(TForm)
...
private
  procedure WMQueryEndSession(var Msg : TLMessage); message
WM_QUERYENDSESSION
...

end;
...

procedure TForm1.WMQueryEndSession(var Msg : TLMessage);
begin
  case Msg.lParam of
     ENDSESSION_CLOSEAPP : ShowMessage('Closing Application'); // Added it
by hand <-
http://msdn.microsoft.com/en-us/library/windows/desktop/aa376890%28v=vs.85%29.aspx
     ENDSESSION_CRITICAL : ShowMessage('Critical reason');
     ENDSESSION_LOGOFF : ShowMessage('Log off');
  end;
  Msg.Result := 1;
end;
...

It looks like the message never fires.

I'm using Windows 7 64 bit, Lazarus 0.9.30.4 FPC 2.6.0 i386

What am I missing or doing wrong ?

Thanks,
Ido
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to