Skip to content

Commit

Permalink
docs: 更新文档明确窗口属性中存储的坐标不受 DPI 虚拟化影响
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Jun 22, 2024
1 parent 5754d8b commit a05855c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/Interact with Magpie programally.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ destRect.bottom = (LONG)(INT_PTR)GetProp(hwndScaling, L"Magpie.DestBottom");

### Notes

These properties are only guaranteed to exist after the scaling window has completed its initialization. Therefore, it is advisable to check whether the scaling window is visible before retrieving these properties, especially when the window handle is obtained using the class name.
1. These properties are only guaranteed to exist after the scaling window has completed its initialization. Therefore, it is advisable to check whether the scaling window is visible before retrieving these properties, especially when the window handle is obtained using the class name.
2. The coordinates stored in these properties are not DPI-virtualized. To use them correctly, you need to set your application's DPI awareness level to Per-Monitor V2. For more details, please refer to [High DPI Desktop Application Development on Windows](https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows).

## How to Keep Magpie Scaling When Your Window Is in the Foreground

Expand Down
3 changes: 2 additions & 1 deletion docs/以编程方式与 Magpie 交互.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ destRect.bottom = (LONG)(INT_PTR)GetProp(hwndScaling, L"Magpie.DestBottom");

### 注意事项

这些属性只在缩放窗口初始化完成后才保证存在,因此建议检索属性前检查缩放窗口是否可见,尤其是当窗口句柄是使用类名获取到的。
1. 这些属性只在缩放窗口初始化完成后才保证存在,因此建议检索属性前检查缩放窗口是否可见,尤其是当窗口句柄是使用类名获取到的。
2. 这些属性中存储的坐标不受 DPI 虚拟化影响,你需要将程序的 DPI 感知级别设置为 Per-Monitor V2 才能正确使用它们。有关详细信息,请参阅 [High DPI Desktop Application Development on Windows](https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows)

## 如何使 Magpie 在你的窗口位于前台时保持缩放

Expand Down

0 comments on commit a05855c

Please sign in to comment.