win32: pass both LogOff and ShutDown to Application.OnQueryEndSession, Application.OnEndSession (bug #0011969)

git-svn-id: trunk@18548 -
This commit is contained in:
paul 2009-02-04 02:24:58 +00:00
parent d3ad27229d
commit 82572a7ab9

View File

@ -2365,8 +2365,9 @@ begin
WM_ENDSESSION: WM_ENDSESSION:
begin begin
if (Application<>nil) and (TWin32WidgetSet(WidgetSet).AppHandle=Window) and if (Application<>nil) and (TWin32WidgetSet(WidgetSet).AppHandle=Window) and
(WParam>0) and (LParam=0) then (WParam>0) then
begin begin
// look at WM_QUERYENDSESSION about LParam
LMessage.Msg := LM_NULL; // no need to go through delivermessage LMessage.Msg := LM_NULL; // no need to go through delivermessage
Application.IntfEndSession(); Application.IntfEndSession();
LMessage.Result := 0; LMessage.Result := 0;
@ -2375,11 +2376,13 @@ begin
WM_QUERYENDSESSION: WM_QUERYENDSESSION:
begin begin
if (Application<>nil) and (TWin32WidgetSet(WidgetSet).AppHandle=Window) and if (Application<>nil) and (TWin32WidgetSet(WidgetSet).AppHandle=Window) then
(LParam=0) then
begin begin
LMessage.Msg := LM_NULL; // no need to go through delivermessage LMessage.Msg := LM_NULL; // no need to go through delivermessage
CancelEndSession := LMessage.Result=0; CancelEndSession := LMessage.Result=0;
// it is possible to pass whether user LogOff or Shutdonw through a flag
// but seems there is no way to do this in a cross-platform way =>
// skip it for now
Application.IntfQueryEndSession(CancelEndSession); Application.IntfQueryEndSession(CancelEndSession);
if CancelEndSession if CancelEndSession
then LMessage.Result := 0 then LMessage.Result := 0