summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2013-09-18 11:49:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-21 07:45:44 +0200
commitac0bacc8afc2f0ed3e1e1a19bdb469f8a4ec557e (patch)
tree0bd9aa7905840d46b968dd08b9e59c1474c78157 /src/corelib/kernel
parent2b65bba77d4705d49a01a25350de64d153808504 (diff)
Port of Qt 4's Windows session management
This patch aims to implement the session management for Windows. Based on the Qt 4 QApplication windows specific code Task-number: QTBUG-28228 Task-number: QTBUG-33032 Change-Id: I7059298ad9661aebd51e77a03f55a7a04f461479 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index dd1b84aa58..418074dc7a 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
@@ -990,6 +991,24 @@ QString decodeMSG(const MSG& msg)
}
break;
#endif
+#ifdef WM_QUERYENDSESSION
+#ifndef ENDSESSION_CLOSEAPP
+#define ENDSESSION_CLOSEAPP 0x00000001
+#endif
+#ifndef ENDSESSION_CRITICAL
+#define ENDSESSION_CRITICAL 0x40000000
+#endif
+ case WM_QUERYENDSESSION:
+ {
+ QString logoffOption = valueCheck(wParam,
+ FLAG_STRING(ENDSESSION_CLOSEAPP, "Close application"),
+ FLAG_STRING(ENDSESSION_CRITICAL, "Force application end"),
+ FLAG_STRING(ENDSESSION_LOGOFF, "User logoff"),
+ FLAG_STRING());
+ parameters.sprintf("End session: %s", logoffOption.toLatin1().data());
+ }
+ break;
+#endif
default:
parameters.sprintf("wParam(0x%p) lParam(0x%p)", (void *)wParam, (void *)lParam);
break;