Declaring high DPI awareness per window on Windows 8

痞子三分冷 提交于 2019-11-27 22:35:57

Per window DPI awareness is now possible, since Windows 10 anniversary update. A new API SetThreadDpiAwarenessContext() can be used to set per window,and per thread DPI awareness. This is accomplished as follows.

  • A thread can now dynamically change its DPI awarensss.
  • DPI awareness of a window created by the thread will depend on the DPI awareness of the calling thread at the time windows was created.
  • When windows procedure for a window is called, the thread is automatically switched to the DPI awareness context that was in use when the window was created.

Read the following references.

You are out of luck here. DPI awareness is a process wide setting. In Windows 8.1 you can declare the process to be DPI aware on a per monitor basis.

And as Raymond comments above, no amount of engineering would enable API functions like GetCursorPos to have per-window DPI awareness, since such functions are not passed windows.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!