Handling WM_NCPAINT “breaks” DWM glass rendering on Vista/Aero

后端 未结 1 1242
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 01:58

I am trying to make a window that alternates between having an Aero/Glass and a custom rendered frame (by handling WM_NCPAINT) based on a user setting. (Windows

相关标签:
1条回答
  • 2020-12-06 02:39

    When toggling between Aero/Glass and your custom rendered frame it you can use the following to explicitly control the non-client area rendering policy:

    DWMNCRENDERINGPOLICY policy = DWMNCRP_ENABLED; // DWMNCRP_DISABLED to toggle back
    DwmSetWindowAttribute(hwnd, 
                          DWMWA_NCRENDERING_POLICY, 
                          (void*)&policy, 
                          sizeof(DWMNCRENDERINGPOLICY));
    
    0 讨论(0)
提交回复
热议问题