DwmExtendFrameIntoClientArea without Aero Glass

前端 未结 3 1275
遥遥无期
遥遥无期 2021-02-05 22:20

Using the DwmExtendFrameIntoClientArea API call with Aero Glass enabled works just fine. However, I want it to work when Aero Glass is disabled as well, like how it

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 23:04

    You have to paint it to be frame-like yourself.

    You have to use DwmIsCompositionEnabled to check if the DWM is enabled and handle WM_DWMCOMPOSITIONCHANGED to detect DWM state changed.

    Then you have to have to separate way of drawing the window, if DWM is enabled you use DwmExtendFrameIntoClientArea, if it's disabled you draw the "frame" yourself.

    I have no idea how to duplicate the Aero frame in WPF (in my app I have my own color scheme and I'm not using the Auro frame).

    This is annoying but when the DWM is disabled the system falls back to XP-style drawing and none of the DWM's services work - even those that aren't related to the glass effect.

提交回复
热议问题