File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1216,17 +1216,33 @@ void EnableHotkeys( THotkeys enable )
12161216 }
12171217}
12181218
1219+ bool IsTouchTaskbar (void )
1220+ {
1221+ if (!IsWin11 ())
1222+ return false ;
1223+
1224+ CRegKey regKey;
1225+ if (regKey.Open (HKEY_CURRENT_USER, L" Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer" ) != ERROR_SUCCESS)
1226+ return false ;
1227+
1228+ DWORD val;
1229+ return regKey.QueryDWORDValue (L" TabletPostureTaskbar" , val) == ERROR_SUCCESS && val;
1230+ }
1231+
12191232static void UpdateStartButtonPosition (const TaskbarInfo* taskBar, const WINDOWPOS* pPos)
12201233{
12211234 if (IsStartButtonSmallIcons (taskBar->taskbarId ) != IsTaskbarSmallIcons ())
12221235 RecreateStartButton (taskBar->taskbarId );
12231236
12241237 RECT rcTask;
12251238 GetWindowRect (taskBar->taskBar , &rcTask);
1226- if (RECT rc; GetWindowRgnBox (taskBar-> taskBar , &rc) != ERROR )
1239+ if (IsTouchTaskbar () )
12271240 {
1228- MapWindowPoints (taskBar->taskBar , NULL , (POINT*)&rc, 2 );
1229- rcTask = rc;
1241+ if (RECT rc; GetWindowRgnBox (taskBar->taskBar , &rc) != ERROR)
1242+ {
1243+ MapWindowPoints (taskBar->taskBar , NULL , (POINT*)&rc, 2 );
1244+ rcTask = rc;
1245+ }
12301246 }
12311247 MONITORINFO info;
12321248 UINT uEdge = GetTaskbarPosition (taskBar->taskBar , &info, NULL , NULL );
You can’t perform that action at this time.
0 commit comments