diff --git a/mods/taskbar-left-click-cycle.wh.cpp b/mods/taskbar-left-click-cycle.wh.cpp index 07b53317d..5a0522837 100644 --- a/mods/taskbar-left-click-cycle.wh.cpp +++ b/mods/taskbar-left-click-cycle.wh.cpp @@ -2,7 +2,7 @@ // @id taskbar-left-click-cycle // @name Cycle through taskbar windows on click // @description Makes clicking on combined taskbar items cycle through windows instead of opening thumbnail previews -// @version 1.1 +// @version 1.1.1 // @author m417z // @github https://github.com/m417z // @twitter https://twitter.com/m417z @@ -214,6 +214,10 @@ bool HookExplorerPatcherSymbols(HMODULE explorerPatcherModule) { return true; } + if (g_winVersion >= WinVersion::Win11) { + g_winVersion = WinVersion::Win10; + } + struct EXPLORER_PATCHER_HOOK { PCSTR symbol; void** pOriginalFunction; @@ -366,19 +370,21 @@ BOOL Wh_ModInit() { if (hasWin10Taskbar && !HookTaskbarSymbols()) { return FALSE; } - - HandleLoadedExplorerPatcher(); - - HMODULE kernelBaseModule = GetModuleHandle(L"kernelbase.dll"); - FARPROC pKernelBaseLoadLibraryExW = - GetProcAddress(kernelBaseModule, "LoadLibraryExW"); - Wh_SetFunctionHook((void*)pKernelBaseLoadLibraryExW, - (void*)LoadLibraryExW_Hook, - (void**)&LoadLibraryExW_Original); } else if (!HookTaskbarSymbols()) { return FALSE; } + HandleLoadedExplorerPatcher(); + + HMODULE kernelBaseModule = GetModuleHandle(L"kernelbase.dll"); + FARPROC pKernelBaseLoadLibraryExW = + GetProcAddress(kernelBaseModule, "LoadLibraryExW"); + Wh_SetFunctionHook((void*)pKernelBaseLoadLibraryExW, + (void*)LoadLibraryExW_Hook, + (void**)&LoadLibraryExW_Original); + + g_initialized = true; + return TRUE; } @@ -387,7 +393,7 @@ void Wh_ModAfterInit() { // Try again in case there's a race between the previous attempt and the // LoadLibraryExW hook. - if (g_settings.oldTaskbarOnWin11 && !g_explorerPatcherInitialized) { + if (!g_explorerPatcherInitialized) { HandleLoadedExplorerPatcher(); } }