简体   繁体   English

应用程序如何在 Windows 10 上检测缩放和监控布局变化

[英]How application can detect scaling and monitors layout change on Windows 10

I have application that can control other application position.我有可以控制其他应用程序位置的应用程序。 On start it get current monitors' layout and dimensions.在开始时,它会获取当前显示器的布局和尺寸。 They are used to calculate the proper position of the window on the secondary monitor with the different (not default) scaling.它们用于计算具有不同(非默认)缩放比例的辅助监视器上窗口的正确位置。 But when the user updates the monitors' layout application keeps using initial values.但是当用户更新监视器的布局应用程序时,它会继续使用初始值。

is there any possibility to capture scaling change or monitors layout change?是否有可能捕获缩放更改或监视器布局更改?

You need to receive and handle the WM_DPICHANGED and WM_DISPLAYCHANGE messages.您需要接收和处理WM_DPICHANGEDWM_DISPLAYCHANGE消息。

I suggest you read MSDN's documentation about High DPI Desktop Application Development and Multiple Display Monitors for more details.我建议您阅读 MSDN 关于高 DPI 桌面应用程序开发多显示器的文档以获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM