Declaring high DPI awareness per window on Windows 8

前端 未结 2 2000
野的像风
野的像风 2020-12-06 03:25

I\'m developing audio plugins that run within a host such as Cubase, and I\'m looking to add High DPI support. This is problematic because all host applications that I know

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 04:11

    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.

    • https://msdn.microsoft.com/en-us/library/windows/desktop/mt744321(v=vs.85).aspx
    • https://github.com/Microsoft/Windows-classic-samples/.../DPIAwarenessPerWindow/
    • (Read the Readme file) https://github.com/Microsoft/Windows-classic-samples/tree/96f883e4c900948e39660ec14a200a5164a3c7b7/Samples/DPIAwarenessPerWindow

提交回复
热议问题