https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c62bccdda030ad88454297af2f4611232435f609

commit c62bccdda030ad88454297af2f4611232435f609
Author:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
AuthorDate: Sun Apr 8 00:33:23 2018 +0200
Commit:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
CommitDate: Sun Apr 8 00:36:56 2018 +0200

    [EXPLORER] Implement the feature of cleanly shutting down the explorer 
shell when cancelling the shutdown-dialog while pressing the CTRL-ALT-SHIFT 
keys.
    
    See the feature description in 
https://msdn.microsoft.com/en-us/library/windows/desktop/cc144064(v=vs.85).aspx
    and the additional observations reported in CORE-14358 .
---
 base/shell/explorer/traywnd.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp
index 2bbe3c5d61..4095bc1046 100644
--- a/base/shell/explorer/traywnd.cpp
+++ b/base/shell/explorer/traywnd.cpp
@@ -327,7 +327,19 @@ public:
 
     LRESULT DoExitWindows()
     {
+        /* Display the ReactOS Shutdown Dialog */
         ExitWindowsDialog(m_hWnd);
+
+        /*
+         * If the user presses CTRL+ALT+SHIFT while exiting
+         * the shutdown dialog, exit the shell cleanly.
+         */
+        if ((GetKeyState(VK_CONTROL) & 0x8000) &&
+            (GetKeyState(VK_SHIFT)   & 0x8000) &&
+            (GetKeyState(VK_MENU)    & 0x8000))
+        {
+            PostMessage(WM_QUIT, 0, 0);
+        }
         return 0;
     }
 

Reply via email to