Search

MFC: Disabling DWM Composition causes redraw issues with CMFCVisualManagerOffice2007 styles by CodeBloke

Closed
as Fixed Help for as Fixed

2
0
Sign in
to vote
Type: Bug
ID: 629703
Opened: 12/8/2010 2:43:21 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
If an MFC application is running on Windows 7 (using Aero) with an 'Office 2007' style and DWM Composition is disabled (either directly or through compatibility issues, e.g. running an older app like Corel PaintShop Pro X) the MFC app is not re-drawn properly. It doesn't appear to happen with the other styles, such as 'Visual Studio 2005' style.

Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

You need to create two apps, one is an MFC app and another is a small Win32 project to switch DWM Composition off.

1. Create a new MFC App with the 'Visual Studio' project style and 'Office 2007 (Silver theme)'
2. Build and run the app
3. Create a new Win32 Project with the default settings
4. At the start of the _tWinMain add a new line:

    DwmEnableComposition( DWM_EC_DISABLECOMPOSITION );

(you'll need to include dwmapi.h and link to dwmapi.lib).
5. Build and run the app

You should see that the first MFC app has a re-draw issue around where the Menu was, the menu appears shifted down and the previous region is not painted at all.

When you close the 2nd Win32 app and DWM Composition is re-enabled something odd happens with the title bar. Sometimes the title bar disappears and sometimes the window controls are painted in a Win95 fashion.

Windows 7 Ultimate, x86, Aero.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

App refresh doesn't happen properly. The menu area has shifted down with the previous region not repainting. Only seems to happen with the Office 2007 style.

You can fix the problem by re-applying the style.

Expected results

App should refresh with the Windows 7 Basic theme.
File Attachments
0 attachments
Sign in to post a comment.
Posted by CodeBloke on 12/10/2010 at 1:52 AM
Does that mean it will be fixed in VS2010 SP1? If not would it be possible to post the fix?

Thanks,
Dave.
Posted by Microsoft on 12/9/2010 at 4:14 PM
Hello,

Thanks for the report. This issue has been fixed in MFC for the next major release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 12/8/2010 at 3:21 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.