For some time, I struggled with this crash in MFC. This can be easily noticed.
- In Visual Studio 2012 Update 1, create a new MFC application,
- several documents / tabbed documents are set in the wizard settings, black style Office 2007
- run the application on Windows 7:
The application launched during the Windows 7 Aero theme:

The theme in the Windows Control Panel is installed on Windows 7 Basic:

The theme in the Windows Control Panel returned to Windows 7 Aero:

Pay attention to the unpainted spaces when turning off the aero and the black heading with the missing close button when returning aero.
This problem has always been around, in Visual Studio 2010, an application that works well when switching themes through the Windows control panel, but still showed a black title after aero was disconnected / reconnected using the DwmEnableComposition () API call.
I was hoping that in Visual Studio 2012 the problem was sorted out , but it doesn't seem to be that way. So what can I do to work around the error?
source share