File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
source/MaaWin32ControlUnit/Manager Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ Win32ControlUnitMgr::Win32ControlUnitMgr(
3131
3232bool Win32ControlUnitMgr::connect ()
3333{
34+ #ifndef MAA_WIN32_COMPATIBLE
35+ // 设置 Per-Monitor DPI Aware V2,确保 GetClientRect/GetWindowRect 等 API 返回物理像素。
36+ // 修复高 DPI 缩放下 PrintWindow/FramePool 等截图方式只能截取部分区域的问题。
37+ auto prev_ctx = SetThreadDpiAwarenessContext (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
38+ if (prev_ctx) {
39+ LogInfo << " SetThreadDpiAwarenessContext to PER_MONITOR_AWARE_V2 success" << VAR_VOIDP (prev_ctx);
40+ }
41+ else {
42+ LogWarn << " SetThreadDpiAwarenessContext failed, error:" << GetLastError ();
43+ }
44+ #endif
45+
3446 if (hwnd_) {
3547 if (!IsWindow (hwnd_)) {
3648 LogError << " hwnd_ is invalid" ;
You can’t perform that action at this time.
0 commit comments