4
votes

For some time I have been struggling with this glitch in MFC. It can be easily observed.

  • In Visual Studio 2012 Update 1 create a new MFC application,
  • in wizard settings set Multiple documents/Tabbed documents, Office 2007 Black style
  • run the application on Windows 7:

Application launched while Windows 7 Aero theme is on:

Windows 7 Aero

Theme in Windows control panel set to Windows 7 Basic:

Windows 7 Basic

Theme in Windows control panel set back to Windows 7 Aero:

Windows 7 Aero again

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?

1
You cannot fix these bugs yourself, especially in VS2012 which no longer supports rebuilding MFC. The only way to go about it is to file a bug report at connect.microsoft.com. I wouldn't hold my breath for an actual bug fix, this is bound to be hard to fix and the use case is very minor. Especially with Windows 8 no longer permitting turning Aero off.Hans Passant
So far I switched back to VisualStudio 2010 and disabled the aero MFC awareness with afxGlobalData.bDisableAero = TRUE. Looks not too bad and have no glitches. But still somebody might have better method.eugensk
300 bounty just because of a graphical glitch by a window's border?Aaron

1 Answers

1
votes

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.