Window selection display issue with Windows Aero theme.

Hello, every one.

I would like to know if anybody experienced the window update issue and have any solution on this.

To reproduce the problem:
1> Set up your windows to use any one of the Aero themes.
2> Run the Viewer3d project included in the OCC MFC sample examples.
3> Try to draw a box window such as the window selection.

If I disable the Aero theme, use "Windows 7 Basic" instead, the problem is gone.

Any suggestion will be greatly appreciated!

zbaekhk's picture

GDI SetROP2 function not working when aero theme is on.
so I use two rubber band functions.
GDI rubber band when aero theme is off, otherwise use OpenGL rubber band.

You can check aero theme is on or off by using below function.
bool IsAeroEnabled()
HMODULE hDwmDLL = LoadLibrary(_T("dwmapi.dll")); /// Loads the DWM DLL
if(!hDwmDLL) return FALSE;

// Everything is fine upto here, we can get function address
*(FARPROC *)&DwmIsCompositionEnabled = GetProcAddress(hDwmDLL,_T("DwmIsCompositionEnabled"));
BOOL bDwmEnabled = false;
return bDwmEnabled;

SF. Fan's picture


Thank you for your suggestion!
I'll have a try today.