DwmEnableComposition (dwmapi)
Last changed: -117.227.23.20

.
Summary
Disables the aero effect on Vista and window 7.

Note This function is deprecated as of Windows 8. DWM can no longer be programmatically disabled.

C# Signature:

      [DllImport("dwmapi.dll", PreserveSig = false)]
      public static extern void DwmEnableComposition(CompositionAction uCompositionAction);

      [Flags]
      public enum CompositionAction : uint
      {
     /// <summary>
     /// To enable DWM composition
     /// </summary>
     DWM_EC_DISABLECOMPOSITION = 0,
     /// <summary>
     /// To disable composition.
     /// </summary>
     DWM_EC_ENABLECOMPOSITION = 1
      }

VB Signature:

    <DllImport("dwmapi.dll")> _
    Public Shared Sub DwmEnableComposition(ByVal uCompositionAction As CompositionAction)
    End Sub

    Public Enum CompositionAction As UInteger
    DWM_EC_DISABLECOMPOSITION = 0
    DWM_EC_ENABLECOMPOSITION = 1
    End Enum

User-Defined Types:

CompositionAction

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code C#:

      public static void DisableAero(bool disable)
      {
     if (disable)
        DwmEnableComposition(CompositionAction.DWM_EC_DISABLECOMPOSITION);
     else
        DwmEnableComposition(CompositionAction.DWM_EC_ENABLECOMPOSITION);
      }

Documentation