Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions mods/notifications-placement.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// @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
// @homepage https://m417z.com/
// @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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'\\')) {
Expand All @@ -937,6 +940,7 @@ BOOL Wh_ModInit() {
}
} else {
Wh_Log(L"GetModuleFileName returned an unsupported path");
return FALSE;
}
break;
}
Expand All @@ -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;
Expand Down