How to make sure the Aero effect is turned on?

Is there an api or something we are doing, is the Glass effect already activated? In some codes that I saw, if a DllNotFoundException throws, then they make sure that it is not active or does not exist. is there a better or standard way?

This solution is to use the Aero effect to expand the glass area in WPF .

+4
source share
1 answer

On this MSDN page , you can discover Glass using DwmIsCompositionEnabled :

When the desktop composition state is changed, the WM_DWMCOMPOSITIONCHANGED message is broadcast. There are no parameters telling you if this is enabled or disabled, so it is up to you to call DwmIsCompositionEnabled if you are interested. The code to perform the verification is simple - the complex part decides how you want to see if the 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 that you can “Enable Aero”, but “Disable Glass”, and if so, what will be the result of this method.

+10
source

All Articles