Skip to content

Commit

Permalink
GUI: Hide Cortana button options on OS builds 22621+
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Aug 5, 2022
1 parent 092edc1 commit 9239e56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ExplorerPatcher/GUI.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ExplorerPatcher/osutility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ExplorerPatcher/settings.reg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9239e56

Please sign in to comment.