From 5a1b2dd3891dcf4c8b549ab19ce7ed7ed0b8ada3 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Thu, 23 Dec 2021 19:47:32 +0200 Subject: [PATCH] Fixed #589 (Windows 11 secondary taskbar is not shown when mouse overed and auto hide is on) --- ExplorerPatcher/dllmain.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 0fc8d28..ef34dc8 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -1425,13 +1425,18 @@ INT64 Shell_TrayWndSubclassProc( _In_ WPARAM wParam, _In_ LPARAM lParam, UINT_PTR uIdSubclass, - DWORD_PTR dwRefData + DWORD_PTR bIsPrimaryTaskbar ) { if (uMsg == WM_NCDESTROY) { RemoveWindowSubclass(hWnd, Shell_TrayWndSubclassProc, Shell_TrayWndSubclassProc); } + else if (!bIsPrimaryTaskbar && uMsg == WM_SETCURSOR) + { + // Received when mouse is over taskbar edge and autohide is on + PostMessageW(hWnd, WM_ACTIVATE, WA_ACTIVE, NULL); + } else if (uMsg == WM_LBUTTONDBLCLK && bTaskbarAutohideOnDoubleClick) { APPBARDATA abd; @@ -4423,7 +4428,11 @@ HWND CreateWindowExWHook( } else if (bIsExplorerProcess && (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"Shell_TrayWnd")) { - SetWindowSubclass(hWnd, Shell_TrayWndSubclassProc, Shell_TrayWndSubclassProc, 0); + SetWindowSubclass(hWnd, Shell_TrayWndSubclassProc, Shell_TrayWndSubclassProc, TRUE); + } + else if (bIsExplorerProcess && (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"Shell_SecondaryTrayWnd")) + { + SetWindowSubclass(hWnd, Shell_TrayWndSubclassProc, Shell_TrayWndSubclassProc, FALSE); } #endif /*