How make sure Aero effect is enabled?

有些话、适合烂在心里 提交于 2019-12-01 07:32:32

On this MSDN page it suggests you can detect Glass using DwmIsCompositionEnabled:

When the status of desktop composition is changed, a WM_DWMCOMPOSITIONCHANGED message is broadcast. There are no parameters telling you if it's being enabled or disabled, so it's up to you to call DwmIsCompositionEnabled if you're interested. The code to do the check is straightforward-the tricky part is deciding how you want your window to look if composition is disabled.

[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();

// Check to see if composition is Enabled
if (Environment.OSVersion.Version.Major >= 6 && DwmIsCompositionEnabled())
{
    // enable glass rendering
}
else
{
    // fallback rendering
}

However I'm not sure whether you can "Enable Aero" but "Disable Glass" and if so, what the result of the method would be.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!