1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-23 23:21:08 +01:00

Taskbar10/Taskbar11: Removed code for redirecting TaskbarGlomLevel registry value

This commit is contained in:
Amrsatrio 2024-10-11 03:48:46 +07:00
parent 41877b694b
commit eb1f1ec95b
3 changed files with 12 additions and 125 deletions

View File

@ -118,13 +118,9 @@ BOOL bDoNotRedirectNotificationIconsToSettingsApp = FALSE;
BOOL bDisableOfficeHotkeys = FALSE; BOOL bDisableOfficeHotkeys = FALSE;
BOOL bDisableWinFHotkey = FALSE; BOOL bDisableWinFHotkey = FALSE;
DWORD bNoPropertiesInContextMenu = FALSE; DWORD bNoPropertiesInContextMenu = FALSE;
#define TASKBARGLOMLEVEL_DEFAULT 2
#define MMTASKBARGLOMLEVEL_DEFAULT 2
DWORD dwTaskbarGlomLevel = TASKBARGLOMLEVEL_DEFAULT;
DWORD dwMMTaskbarGlomLevel = MMTASKBARGLOMLEVEL_DEFAULT;
HMODULE hModule = NULL; HMODULE hModule = NULL;
HANDLE hShell32 = NULL; HANDLE hShell32 = NULL;
HANDLE hDelayedInjectionThread = NULL; // HANDLE hDelayedInjectionThread = NULL;
HANDLE hSwsSettingsChanged = NULL; HANDLE hSwsSettingsChanged = NULL;
HANDLE hSwsOpacityMaybeChanged = NULL; HANDLE hSwsOpacityMaybeChanged = NULL;
HANDLE hWin11AltTabInitialized = NULL; HANDLE hWin11AltTabInitialized = NULL;
@ -4991,7 +4987,7 @@ __declspec(dllexport) BOOL explorer_SetChildWindowNoActivateHook(HWND hWnd)
VirtualProtect(PeopleButton_Instance + 32, sizeof(uintptr_t), dwOldProtect, &dwOldProtect); VirtualProtect(PeopleButton_Instance + 32, sizeof(uintptr_t), dwOldProtect, &dwOldProtect);
uintptr_t off_PeopleButton_ShowTooltip = 0; uintptr_t off_PeopleButton_ShowTooltip = 0;
if (IsWindows11()) if (bOldTaskbar >= 2 || IsWindows11())
{ {
off_PeopleButton_ShowTooltip = 224; off_PeopleButton_ShowTooltip = 224;
} }
@ -5005,7 +5001,7 @@ __declspec(dllexport) BOOL explorer_SetChildWindowNoActivateHook(HWND hWnd)
VirtualProtect(Instance + off_PeopleButton_ShowTooltip, sizeof(uintptr_t), dwOldProtect, &dwOldProtect); VirtualProtect(Instance + off_PeopleButton_ShowTooltip, sizeof(uintptr_t), dwOldProtect, &dwOldProtect);
uintptr_t off_PeopleButton_OnClick = 0; uintptr_t off_PeopleButton_OnClick = 0;
if (IsWindows11()) if (bOldTaskbar >= 2 || IsWindows11())
{ {
off_PeopleButton_OnClick = 160; off_PeopleButton_OnClick = 160;
} }
@ -5579,43 +5575,6 @@ void WINAPI LoadSettings(LPARAM lParam)
sizeof(DWORD) sizeof(DWORD)
); );
RegDeleteKeyExW(hKey, TEXT(STARTDOCKED_SB_NAME), KEY_WOW64_64KEY, 0); RegDeleteKeyExW(hKey, TEXT(STARTDOCKED_SB_NAME), KEY_WOW64_64KEY, 0);
DWORD dwTaskbarGlomLevel = 0, dwMMTaskbarGlomLevel = 0;
dwSize = sizeof(DWORD);
RegGetValueW(
HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
L"TaskbarGlomLevel",
REG_DWORD,
NULL,
&dwTaskbarGlomLevel,
&dwSize
);
RegSetValueExW(
hKey,
TEXT("TaskbarGlomLevel"),
0,
REG_DWORD,
&dwTaskbarGlomLevel,
sizeof(DWORD)
);
dwSize = sizeof(DWORD);
RegGetValueW(
HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
L"MMTaskbarGlomLevel",
REG_DWORD,
NULL,
&dwMMTaskbarGlomLevel,
&dwSize
);
RegSetValueExW(
hKey,
TEXT("MMTaskbarGlomLevel"),
0,
REG_DWORD,
&dwMMTaskbarGlomLevel,
sizeof(DWORD)
);
} }
} }
dwTemp = TRUE; dwTemp = TRUE;
@ -6494,45 +6453,6 @@ void WINAPI LoadSettings(LPARAM lParam)
LeaveCriticalSection(&lock_epw); LeaveCriticalSection(&lock_epw);
#endif #endif
dwTemp = TASKBARGLOMLEVEL_DEFAULT;
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("TaskbarGlomLevel"),
0,
NULL,
&dwTemp,
&dwSize
);
if (bOldTaskbar && (dwTemp != dwTaskbarGlomLevel))
{
dwRefreshUIMask = REFRESHUI_GLOM;
if (dwOldTaskbarAl)
{
dwRefreshUIMask |= REFRESHUI_CENTER;
}
}
dwTaskbarGlomLevel = dwTemp;
dwTemp = MMTASKBARGLOMLEVEL_DEFAULT;
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("MMTaskbarGlomLevel"),
0,
NULL,
&dwTemp,
&dwSize
);
if (bOldTaskbar && (dwTemp != dwMMTaskbarGlomLevel))
{
dwRefreshUIMask = REFRESHUI_GLOM;
if (dwMMOldTaskbarAl)
{
dwRefreshUIMask |= REFRESHUI_CENTER;
}
}
dwMMTaskbarGlomLevel = dwTemp;
RegCloseKey(hKey); RegCloseKey(hKey);
} }
@ -6748,20 +6668,6 @@ void WINAPI LoadSettings(LPARAM lParam)
} }
if (dwRefreshUIMask & REFRESHUI_TASKBAR) if (dwRefreshUIMask & REFRESHUI_TASKBAR)
{ {
// this is mostly a hack...
/*DWORD dwGlomLevel = 2, dwSize = sizeof(DWORD), dwNewGlomLevel;
RegGetValueW(HKEY_CURRENT_USER, IsWindows11() ? TEXT(REGPATH) : L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel", RRF_RT_DWORD, NULL, &dwGlomLevel, &dwSize);
Sleep(100);
dwNewGlomLevel = 0;
RegSetKeyValueW(HKEY_CURRENT_USER, IsWindows11() ? TEXT(REGPATH) : L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel", REG_DWORD, &dwNewGlomLevel, sizeof(DWORD));
Explorer_RefreshUI(0);
Sleep(100);
dwNewGlomLevel = 2;
RegSetKeyValueW(HKEY_CURRENT_USER, IsWindows11() ? TEXT(REGPATH) : L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel", REG_DWORD, &dwNewGlomLevel, sizeof(DWORD));
Explorer_RefreshUI(0);
Sleep(100);
RegSetKeyValueW(HKEY_CURRENT_USER, IsWindows11() ? TEXT(REGPATH) : L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel", REG_DWORD, &dwGlomLevel, sizeof(DWORD));
Explorer_RefreshUI(0);*/
} }
if (dwRefreshUIMask & REFRESHUI_CENTER) if (dwRefreshUIMask & REFRESHUI_CENTER)
{ {
@ -8376,16 +8282,6 @@ LSTATUS explorer_RegGetValueW(
*(DWORD*)pvData = 1; *(DWORD*)pvData = 1;
} }
} }
else if (IsWindows11() && (!lstrcmpW(lpValue, L"TaskbarGlomLevel") || !lstrcmpW(lpValue, L"MMTaskbarGlomLevel")))
{
lRes = RegGetValueW(HKEY_CURRENT_USER, _T(REGPATH), lpValue, dwFlags, pdwType, pvData, pcbData);
if (lRes != ERROR_SUCCESS)
{
*(DWORD*)pvData = (lpValue[0] == L'T' ? TASKBARGLOMLEVEL_DEFAULT : MMTASKBARGLOMLEVEL_DEFAULT);
*(DWORD*)pcbData = sizeof(DWORD32);
lRes = ERROR_SUCCESS;
}
}
/*else if (!lstrcmpW(lpValue, L"PeopleBand")) /*else if (!lstrcmpW(lpValue, L"PeopleBand"))
{ {
lRes = RegGetValueW(hkey, lpSubKey, L"TaskbarMn", dwFlags, pdwType, pvData, pcbData); lRes = RegGetValueW(hkey, lpSubKey, L"TaskbarMn", dwFlags, pdwType, pvData, pcbData);
@ -11005,11 +10901,6 @@ DWORD Inject(BOOL bIsExplorer)
else else
{ {
CreateThread(0, 0, FixTaskbarAutohide, 0, 0, 0); CreateThread(0, 0, FixTaskbarAutohide, 0, 0, 0);
if (!IsWindows11Version22H2Build2361OrHigher())
{
RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel");
RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"MMTaskbarGlomLevel");
}
} }
} }

View File

@ -92,13 +92,6 @@ inline BOOL IsWindows11Version22H2Build2134OrHigher()
return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2134; return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2134;
} }
inline BOOL IsWindows11Version22H2Build2361OrHigher()
{
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_rovi.dwBuildNumber > 22621) return TRUE;
return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2361;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -91,16 +91,19 @@
;x 3 %R:1034% ;x 3 %R:1034%
;x 7 %R:1035% ;x 7 %R:1035%
"MMOldTaskbarAl"=dword:00000000 "MMOldTaskbarAl"=dword:00000000
;g Taskbar_Windows10Section
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 3 %R:1037% ;c 3 %R:1037%
;x 0 %R:1039% ;x 0 %R:1038%
;x 1 %R:1040% ;x 1 %R:1040%
;x 2 %R:1041% ;x 2 %R:1042%
"TaskbarGlomLevel"=dword:00000002 "TaskbarGlomLevel"=dword:00000000
;c 3 %R:1043% ;c 3 %R:1043%
;x 0 %R:1039% ;x 0 %R:1038%
;x 1 %R:1040% ;x 1 %R:1040%
;x 2 %R:1041% ;x 2 %R:1042%
"MMTaskbarGlomLevel"=dword:00000002 "MMTaskbarGlomLevel"=dword:00000000
;s Taskbar_Windows10Section IsOldTaskbar
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 2 %R:1044% ;c 2 %R:1044%
;x 1 %R:1045% ;x 1 %R:1045%