diff --git a/mods/notifications-placement.wh.cpp b/mods/notifications-placement.wh.cpp index 4e3f37c071..fa737291e8 100644 --- a/mods/notifications-placement.wh.cpp +++ b/mods/notifications-placement.wh.cpp @@ -2,7 +2,7 @@ // @id notifications-placement // @name Customize Windows notifications placement // @description Move notifications to another monitor or another corner of the screen -// @version 1.2.2 +// @version 1.2.3 // @author m417z // @github https://github.com/m417z // @twitter https://twitter.com/m417z @@ -10,7 +10,7 @@ // @include explorer.exe // @include ShellExperienceHost.exe // @architecture x86-64 -// @compilerOptions -DWINVER=0x0A00 -lole32 -loleaut32 -lruntimeobject -lshcore +// @compilerOptions -lole32 -loleaut32 -lruntimeobject -lshcore // ==/WindhawkMod== // Source code is published under The GNU General Public License v3.0. @@ -366,7 +366,7 @@ bool IsTargetCoreWindow(HWND hWnd) { L"Ný tilkynning", // IS-IS L"ახალი შეტყობინება", // KA-GE L"Жаңа хабарландыру", // KK-KZ - L"ការ​ជូន​ដំណឹង​ថ្មី", // KM-KH + L"ការ\u200bជូន\u200bដំណឹង\u200bថ្មី", // KM-KH L"ಹೊಸ ಪ್ರಕಟಣೆ", // KN-IN L"नवी अधिसुचोवणी", // KOK-IN L"Nei Notifikatioun", // LB-LU @@ -736,18 +736,21 @@ void UpdateAnimationDirectionStyle() { return false; // continue enumeration } - FrameworkElement revealGrid2 = - FindChildByName(mainGrid, L"RevealGrid2"); - if (!revealGrid2) { - return false; // continue enumeration + FrameworkElement revealGrid = FindChildByName(mainGrid, L"RevealGrid"); + if (!revealGrid) { + // Older Windows 11 versions use this name (before ~Jul 2026). + revealGrid = FindChildByName(mainGrid, L"RevealGrid2"); + if (!revealGrid) { + return false; // continue enumeration + } } Wh_Log(L"Applying transform to toast view %s", name.c_str()); Media::RotateTransform transform; transform.Angle(-angle); - revealGrid2.RenderTransform(transform); - revealGrid2.RenderTransformOrigin(origin); + revealGrid.RenderTransform(transform); + revealGrid.RenderTransformOrigin(origin); foundAnyRootGridContent = true; return false; // continue enumeration to find all matching children @@ -927,7 +930,7 @@ BOOL Wh_ModInit() { case 0: case ARRAYSIZE(moduleFilePath): Wh_Log(L"GetModuleFileName failed"); - break; + return FALSE; default: if (PCWSTR moduleFileName = wcsrchr(moduleFilePath, L'\\')) { @@ -937,6 +940,7 @@ BOOL Wh_ModInit() { } } else { Wh_Log(L"GetModuleFileName returned an unsupported path"); + return FALSE; } break; } @@ -949,9 +953,8 @@ BOOL Wh_ModInit() { return FALSE; } - WindhawkUtils::Wh_SetFunctionHookT(MonitorFromPoint, - MonitorFromPoint_Hook, - &MonitorFromPoint_Original); + WindhawkUtils::SetFunctionHook(MonitorFromPoint, MonitorFromPoint_Hook, + &MonitorFromPoint_Original); } return TRUE;