Aero themes cause problems when using transparent png and other BitBlting images. In the Aero theme, transparency is obtained when I use AlphaBlend instead of BitBlt and CPngImage instead of CBitmap and set the BLENDFUNCTION structure with some transparency from 0 to 255 in BLENDFUNCTION :: SourceConstantAlpha. I use this approach when I want to have a transparent background or just fade out as translucent (opacity 0-255) and when the Aero theme is swept away for all the transparency. Therefore, I will disable aerodynamics transparency using the DwmEnableComposition (DWM_EC_DISABLECOMPOSITION);
HRESULT hr = S_OK; hr = DwmEnableComposition(DWM_EC_DISABLECOMPOSITION); if (SUCCEEDED(hr)){ // Aero theme effect is off! No more swept away transparency }
just call it in OnInitDialog () or some earlier window instance function. It does the trick.
source share