diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 7ca64f7..2c849e5 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -11115,7 +11115,10 @@ DWORD Inject(BOOL bIsExplorer) if (IsWindows11()) { HANDLE hInputSwitch = LoadLibraryW(L"InputSwitch.dll"); - printf("[IME] Context menu patch status: %d\n", PatchContextMenuOfNewMicrosoftIME(NULL)); + if (bOldTaskbar) + { + printf("[IME] Context menu patch status: %d\n", PatchContextMenuOfNewMicrosoftIME(NULL)); + } if (hInputSwitch) { VnPatchIAT(hInputSwitch, "user32.dll", "TrackPopupMenuEx", inputswitch_TrackPopupMenuExHook); diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index 3d5a830..febce86 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -536,7 +536,19 @@ inline BOOL WINAPI PatchContextMenuOfNewMicrosoftIME(BOOL* bFound) { // huge thanks to @Simplestas: https://github.com/valinet/ExplorerPatcher/issues/598 if (bFound) *bFound = FALSE; - const DWORD patch_from = 0x50653844, patch_to = 0x54653844; // cmp byte ptr [rbp+50h], r12b + DWORD patch_from, patch_to; + if (IsWindows11Version22H2OrHigher()) + { + // cmp byte ptr [rbp+40h+arg_0], r13b + patch_from = 0x506D3844; + patch_to = 0x546D3844; + } + else + { + // cmp byte ptr [rbp+50h], r12b + patch_from = 0x50653844; + patch_to = 0x54653844; + } HMODULE hInputSwitch = NULL; if (!GetModuleHandleExW(0, L"InputSwitch.dll", &hInputSwitch)) {