Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

DwmEnableComposition (dwmapi)
 
.
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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions