From b177b4974394d0ad83249318802dfe2ebb0e7044 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Sun, 3 Oct 2021 06:06:30 +0300 Subject: [PATCH] Fixed show desktop on Win+X --- ExplorerPatcher/dllmain.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 1f79ae2..921e16c 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -239,7 +239,12 @@ DWORD ShowLauncherTipContextMenu( (char*)params->_this - 0x58, 7 ); - ShowWindow(hWinXWnd, SW_SHOW); + // DO NOT USE ShowWindow here; it breaks the window order + // and renders the desktop toggle unusable; but leave + // SetForegroundWindow as is so that the menu gets dismissed + // when the user clicks outside it + // + // ShowWindow(hWinXWnd, SW_SHOW); SetForegroundWindow(hWinXWnd); while (!(*((HMENU*)((char*)params->_this + 0xe8)))) @@ -990,7 +995,13 @@ FARPROC explorer_GetProcAddressHook(HMODULE hModule, const CHAR* lpProcName) #pragma region "Open power user menu on Win+X" LRESULT explorer_SendMessageW(HWND hWndx, UINT uMsg, WPARAM wParam, LPARAM lParam) { - if (uMsg == TB_GETTEXTROWS) + if (uMsg == 0x579) // "Raise desktop" - basically shows desktop or the windows + // wParam = 3 => show desktop + // wParam = 2 => raise windows + { + + } + else if (uMsg == TB_GETTEXTROWS) { HWND hWnd = FindWindowEx( NULL,