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

前端 未结 4 1632
佛祖请我去吃肉
佛祖请我去吃肉 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:44

    Does anyone how the devs at MS did this?

    This has a pretty disappointing answer. Using Alin Constantin's WinCheat and inspecting the top-level window of Calculator, I see a window size of 320x576, and a client size that is also 320x576.

    In other words, Microsoft entirely avoids the problem by suppressing the non-client area of the window, putting everything in the client area instead. Making this work well for you may involve custom drawing of the title bar.

    Something worth noting is that Calculator and e.g. Windows Explorer don't use the same colour for the title bars. Calculator doing custom drawing of the title bar would explain that perfectly.

提交回复
热议问题