From f60e2a18cbc6e3ad3db4da74d2e58d528b0d1e4c Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Wed, 4 Dec 2024 19:54:58 +0100 Subject: [PATCH] Fix custom button auto-hiding (#2041) --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index ce80cee8f..0cfcdee7b 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1222,8 +1222,14 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO RecreateStartButton(taskBar->taskbarId); RECT rcTask; + GetWindowRect(taskBar->taskBar, &rcTask); + if (RECT rc; GetWindowRgnBox(taskBar->taskBar, &rc) != ERROR) + { + MapWindowPoints(taskBar->taskBar, NULL, (POINT*)&rc, 2); + rcTask = rc; + } MONITORINFO info; - UINT uEdge = GetTaskbarPosition(taskBar->taskBar, &info, NULL, &rcTask); + UINT uEdge = GetTaskbarPosition(taskBar->taskBar, &info, NULL, NULL); DWORD buttonFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE; if (IsWindowVisible(taskBar->taskBar)) buttonFlags |= SWP_SHOWWINDOW;