mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
* feat(tool): Kirikiri 模拟添加弹窗 * fix: 禁止同一进程内类名相同的窗口打断缩放 * fix: 正在缩放窗口时禁止自动缩放它的弹窗 * fix: 增加两个窗口位于同一进程的条件 * chore: 添加注释
16 lines
507 B
C++
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);
|
|
}
|