How do you scale the title bar on a DPI aware win application?

前端 未结 4 1627
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 08:20

I am making my app dpi-aware per monitor by setting True/PM in the manifest file. I can verify with process explorer that this

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 08:34

    UPDATE:

    It is enough to add new declaration to manifest to solve all this mess. Example is here.

    Remnants of former investigations (obsolete):

    More investigations on the subject.

    System setup: two monitors, one is 96 dpi another one is 267 dpi (Microsoft Surface 4).

    Testing window is moved to secondary 96 dpi monitor:

    Here is rendering (wrong, IMO) with true/pm in manifest:

    Note huge size of caption bar and wrong sizes of window icons.

    And here is correct rendering using true

    And I suspect that MSDN documentation is plainly misleading about values of PROCESS_DPI_AWARENESS. I do not see any differences in messages and styles between true and true/pm. The later one just makes caption larger. In both case application receives WM_DPICHANGED message while moving between monitors with different DPI.

    Sigh.

提交回复
热议问题