Magpie/tools/WindowCase/Utils.cpp
Xu 74d26e4a0d
正在缩放窗口时禁止自动缩放它的弹窗 (#1276)
* feat(tool): Kirikiri 模拟添加弹窗

* fix: 禁止同一进程内类名相同的窗口打断缩放

* fix: 正在缩放窗口时禁止自动缩放它的弹窗

* fix: 增加两个窗口位于同一进程的条件

* chore: 添加注释
2025-08-26 20:02:26 +08:00

16 lines
507 B
C++

#include "pch.h"
#include "Utils.h"
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
RECT Utils::MonitorRectFromWindow(HWND hWnd) noexcept {
HMONITOR hMon = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO mi{ sizeof(mi) };
GetMonitorInfo(hMon, &mi);
return mi.rcMonitor;
}
// https://github.com/microsoft/wil/blob/1fae8ac13f393d727d6c3dba50b1dfe3f63e835b/include/wil/win32_helpers.h#L788
HINSTANCE Utils::GetModuleInstanceHandle() noexcept {
return reinterpret_cast<HINSTANCE>(&__ImageBase);
}