Browse Source

GUI: Hide Cortana button options on OS builds 22621+

pull/1138/head
Valentin Radu 3 years ago
parent
commit
9239e56172
  1. 1
      ExplorerPatcher/GUI.c
  2. 7
      ExplorerPatcher/osutility.h
  3. 2
      ExplorerPatcher/settings.reg

1
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, "!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, "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) if (bSkipLines)
{ {
do do

7
ExplorerPatcher/osutility.h

@ -55,4 +55,11 @@ inline HRESULT SetMicaMaterialForThisWindow(HWND hWnd, BOOL bApply)
DWORD dwProp = (bApply ? ((global_rovi.dwBuildNumber >= 22523) ? 2 : 1) : 0); DWORD dwProp = (bApply ? ((global_rovi.dwBuildNumber >= 22523) ? 2 : 1) : 0);
return DwmSetWindowAttribute(hWnd, dwAttribute, &dwProp, sizeof(DWORD)); 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 #endif

2
ExplorerPatcher/settings.reg

@ -29,12 +29,14 @@
;x 0 Left ;x 0 Left
;x 2 Right ;x 2 Right
;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_MMTaskbarPosition"=dword:00000003 ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_MMTaskbarPosition"=dword:00000003
;s Taskbar_CortanaButtonSection !IsWindows11Version22H2OrHigher
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 3 Extra button should be ;c 3 Extra button should be
;x 0 Hidden (default) ;x 0 Hidden (default)
;x 2 Shown and open Cortana ;x 2 Shown and open Cortana
;x 1 Shown and open Widgets ;x 1 Shown and open Widgets
"TaskbarDa"=dword:00000000 "TaskbarDa"=dword:00000000
;g Taskbar_CortanaButtonSection
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search]
;b Show Search button ;b Show Search button
"SearchboxTaskbarMode"=dword:00000001 "SearchboxTaskbarMode"=dword:00000001

Loading…
Cancel
Save