Skip to content

Commit

Permalink
Taskbar10/Taskbar11: Removed code for redirecting TaskbarGlomLevel re…
Browse files Browse the repository at this point in the history
…gistry value
  • Loading branch information
Amrsatrio committed Oct 10, 2024
1 parent 41877b6 commit eb1f1ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 125 deletions.
115 changes: 3 additions & 112 deletions ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,9 @@ BOOL bDoNotRedirectNotificationIconsToSettingsApp = FALSE;
BOOL bDisableOfficeHotkeys = FALSE;
BOOL bDisableWinFHotkey = FALSE;
DWORD bNoPropertiesInContextMenu = FALSE;
#define TASKBARGLOMLEVEL_DEFAULT 2
#define MMTASKBARGLOMLEVEL_DEFAULT 2
DWORD dwTaskbarGlomLevel = TASKBARGLOMLEVEL_DEFAULT;
DWORD dwMMTaskbarGlomLevel = MMTASKBARGLOMLEVEL_DEFAULT;
HMODULE hModule = NULL;
HANDLE hShell32 = NULL;
HANDLE hDelayedInjectionThread = NULL;
// HANDLE hDelayedInjectionThread = NULL;
HANDLE hSwsSettingsChanged = NULL;
HANDLE hSwsOpacityMaybeChanged = NULL;
HANDLE hWin11AltTabInitialized = NULL;
Expand Down Expand Up @@ -4991,7 +4987,7 @@ __declspec(dllexport) BOOL explorer_SetChildWindowNoActivateHook(HWND hWnd)
VirtualProtect(PeopleButton_Instance + 32, sizeof(uintptr_t), dwOldProtect, &dwOldProtect);

uintptr_t off_PeopleButton_ShowTooltip = 0;
if (IsWindows11())
if (bOldTaskbar >= 2 || IsWindows11())
{
off_PeopleButton_ShowTooltip = 224;
}
Expand All @@ -5005,7 +5001,7 @@ __declspec(dllexport) BOOL explorer_SetChildWindowNoActivateHook(HWND hWnd)
VirtualProtect(Instance + off_PeopleButton_ShowTooltip, sizeof(uintptr_t), dwOldProtect, &dwOldProtect);

uintptr_t off_PeopleButton_OnClick = 0;
if (IsWindows11())
if (bOldTaskbar >= 2 || IsWindows11())
{
off_PeopleButton_OnClick = 160;
}
Expand Down Expand Up @@ -5579,43 +5575,6 @@ void WINAPI LoadSettings(LPARAM lParam)
sizeof(DWORD)
);
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;
Expand Down Expand Up @@ -6494,45 +6453,6 @@ void WINAPI LoadSettings(LPARAM lParam)

LeaveCriticalSection(&lock_epw);
#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);
}

Expand Down Expand Up @@ -6748,20 +6668,6 @@ void WINAPI LoadSettings(LPARAM lParam)
}
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)
{
Expand Down Expand Up @@ -8376,16 +8282,6 @@ LSTATUS explorer_RegGetValueW(
*(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"))
{
lRes = RegGetValueW(hkey, lpSubKey, L"TaskbarMn", dwFlags, pdwType, pvData, pcbData);
Expand Down Expand Up @@ -11005,11 +10901,6 @@ DWORD Inject(BOOL bIsExplorer)
else
{
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");
}
}
}

Expand Down
7 changes: 0 additions & 7 deletions ExplorerPatcher/osutility.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ inline BOOL IsWindows11Version22H2Build2134OrHigher()
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
}
#endif
Expand Down
15 changes: 9 additions & 6 deletions ep_gui/resources/settings.reg
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@
;x 3 %R:1034%
;x 7 %R:1035%
"MMOldTaskbarAl"=dword:00000000
;g Taskbar_Windows10Section
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 3 %R:1037%
;x 0 %R:1039%
;x 0 %R:1038%
;x 1 %R:1040%
;x 2 %R:1041%
"TaskbarGlomLevel"=dword:00000002
;x 2 %R:1042%
"TaskbarGlomLevel"=dword:00000000
;c 3 %R:1043%
;x 0 %R:1039%
;x 0 %R:1038%
;x 1 %R:1040%
;x 2 %R:1041%
"MMTaskbarGlomLevel"=dword:00000002
;x 2 %R:1042%
"MMTaskbarGlomLevel"=dword:00000000
;s Taskbar_Windows10Section IsOldTaskbar
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 2 %R:1044%
;x 1 %R:1045%
Expand Down

0 comments on commit eb1f1ec

Please sign in to comment.