diff --git a/Src/StartMenu/StartMenuDLL/MenuContainer.cpp b/Src/StartMenu/StartMenuDLL/MenuContainer.cpp index 0de4d05..ac9b872 100644 --- a/Src/StartMenu/StartMenuDLL/MenuContainer.cpp +++ b/Src/StartMenu/StartMenuDLL/MenuContainer.cpp @@ -7652,6 +7652,9 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr // initialize all settings bool bErr=false; HMONITOR initialMonitor=MonitorFromWindow(s_TaskBar,MONITOR_DEFAULTTONEAREST); + // note: GetTaskbarPosition properly identifies monitor in case of multi-monitor setup and automatic taskbar hiding + GetTaskbarPosition(s_TaskBar,NULL,&initialMonitor,NULL); + int dpi=CItemManager::GetDPI(true); if (!CItemManager::GetDPIOverride() && GetWinVersion()>=WIN_VER_WIN81) { diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 6a0ec53..8857fa3 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -617,12 +617,12 @@ UINT GetTaskbarPosition( HWND taskBar, MONITORINFO *pInfo, HMONITOR *pMonitor, R if (pRc->right>rc.right) pRc->right=rc.right; } } + HMONITOR monitor=MonitorFromRect(&appbar.rc,MONITOR_DEFAULTTONEAREST); + if (pMonitor) *pMonitor=monitor; if (pInfo) { pInfo->cbSize=sizeof(MONITORINFO); - HMONITOR monitor=MonitorFromRect(&appbar.rc,MONITOR_DEFAULTTONEAREST); GetMonitorInfo(monitor,pInfo); - if (pMonitor) *pMonitor=monitor; } return appbar.uEdge; }