Handling WM_NCPAINT “breaks” DWM glass rendering on Vista/Aero
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 Vista). DwmComposition is enabled. My app comes up with the glass frame, but as soon as I toggle the setting to trigger the custom WM_NCPAINT codepath then toggle back to use DefWindowProc 's WM_NCPAINT handling, the native frame is now perpetually stuck in the "Vista Basic" style - it's no longer translucent and the caption buttons look different to the normal Aero/Glass ones. I've tried just about every way of poking the window from