Windows Aero - Programmatically Disabling Visual E

2019-06-25 16:37发布

Does anyone know how if there is an API to programmatically disable/enable specific Windows visual effects, like "Enable Transparent Glass" or "Enable Aero Peek" ?

The effects I am referring to are those configured in: System/Advanced System preferences/Advanced (tab)/Performance Settings/Custom

I am creating an accessibility tool for Windows and I need to disable some visual effects because they are "invisible" for sight-impaired users. Also, I need to save some CPU cycles for the screen magnification and color adjustments.

thanks

2条回答
Deceive 欺骗
2楼-- · 2019-06-25 17:26

Aero themes makes troubles when BitBlting transparent png and other images. In Aero theme the transparency get screw when I use AlphaBlend instead BitBlt, and CPngImage in lieu of CBitmap, and set BLENDFUNCTION structure with some transparency from 0-255 in BLENDFUNCTION::SourceConstantAlpha. I use this approach when I want to have transparent background or merely fade as semitransparent (opacity 0-255) And when Aero theme is on all transparency swept away. So I disable the aero theme transparency with 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 into OnInitDialog() or some earlier window instance function. That's do the trick

查看更多
相关推荐>>
3楼-- · 2019-06-25 17:30

No, it can be disabled while a particular application is running using DwmEnableComposition().

Changing it globally is internal to windows and should really be done by the user.

查看更多
登录 后发表回答