diff --git a/ExplorerPatcher/GUI.c b/ExplorerPatcher/GUI.c index 1c1a98ad5..c22c420b3 100644 --- a/ExplorerPatcher/GUI.c +++ b/ExplorerPatcher/GUI.c @@ -1080,6 +1080,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) else if (!_stricmp(funcName, "IsWindows10StartMenu") && (dwRes = 0, RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"Start_ShowClassicMode", RRF_RT_DWORD, NULL, &dwRes, &dwSize), (dwRes != 1))) bSkipLines = TRUE; else if (!_stricmp(funcName, "!IsWindows10StartMenu") && (dwRes = 0, RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"Start_ShowClassicMode", RRF_RT_DWORD, NULL, &dwRes, &dwSize), (dwRes == 1))) bSkipLines = TRUE; else if (!_stricmp(funcName, "IsWeatherEnabled") && (dwRes = 0, RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People", L"PeopleBand", RRF_RT_DWORD, NULL, &dwRes, &dwSize), (dwRes != 1))) bSkipLines = TRUE; + else if (!_stricmp(funcName, "!IsWindows11Version22H2OrHigher") && IsWindows11Version22H2OrHigher()) bSkipLines = TRUE; if (bSkipLines) { do diff --git a/ExplorerPatcher/osutility.h b/ExplorerPatcher/osutility.h index a745c3a7e..656dad700 100644 --- a/ExplorerPatcher/osutility.h +++ b/ExplorerPatcher/osutility.h @@ -55,4 +55,11 @@ inline HRESULT SetMicaMaterialForThisWindow(HWND hWnd, BOOL bApply) DWORD dwProp = (bApply ? ((global_rovi.dwBuildNumber >= 22523) ? 2 : 1) : 0); return DwmSetWindowAttribute(hWnd, dwAttribute, &dwProp, sizeof(DWORD)); } + +inline BOOL IsWindows11Version22H2OrHigher() +{ + if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); + if (global_rovi.dwBuildNumber >= 22621) return TRUE; + return FALSE; +} #endif \ No newline at end of file diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index 418fc7837..641751a45 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -29,12 +29,14 @@ ;x 0 Left ;x 2 Right ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_MMTaskbarPosition"=dword:00000003 +;s Taskbar_CortanaButtonSection !IsWindows11Version22H2OrHigher [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] ;c 3 Extra button should be ;x 0 Hidden (default) ;x 2 Shown and open Cortana ;x 1 Shown and open Widgets "TaskbarDa"=dword:00000000 +;g Taskbar_CortanaButtonSection [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] ;b Show Search button "SearchboxTaskbarMode"=dword:00000001