For some time I have been struggling with this glitch in MFC. It can be easily observed.
Notice the unpainted gaps when aero off, and black title with missing close button when aero back on.
This problem has always been around, in Visual Studio 2010 wizard generated application used to work ok with themes switching through Windows control panel, but still showed black title after aero was disabled/reenabled with DwmEnableComposition() API call.
I hoped that in Visual Studio 2012 the problem was sorted out, but seems it was not. So what can I do to workaround the bug?
I suppose that Windows Aero Glass background is broken after hibernate. How can I solve this? is basically the same problem.
Hence the answer to that question should be what you are looking for.