Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Reference
Functions
 DwmEnableComposition Function
DwmEnableComposition Function

Enables or disables Desktop Window Manager (DWM) composition.

Syntax

HRESULT DwmEnableComposition(      
    UINT uCompositionAction );

Parameters

uCompositionAction
DWM_EC_ENABLECOMPOSITION to enable DWM composition; DWM_EC_DISABLECOMPOSITION to disable composition.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Disabling DWM composition disables it for the entire desktop. DWM composition will be automatically enabled when all processes that have disabled composition have called DwmEnableComposition to enable it or have been terminated. The WM_DWMCOMPOSITIONCHANGED notification is sent when DWM composition has enabled or disabled.

Example

The following code example disables DWM composition.

...
HRESULT hr = S_OK;

// Disable DWM Composition 
hr = DwmEnableComposition(DWM_EC_DISABLECOMPOSITION);
if (SUCCEEDED(hr))
{
   // ...
}
...

Function Information

Minimum DLL Versiondwmapi.dll
Headerdwmapi.h
Import librarydwmapi.lib
Minimum operating systems Windows Vista

See Also

Enable and Control DWM Composition
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Sample for C#      tehnolog   |   Edit   |   Show History

//Alexander Klimoff (http://developer.alexanderklimov)

// See also MSDN Magazine April 2007

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

// turn off Aero Glass
DwmEnableComposition(false);

Tags What's this?: c# (x) example (x) syntax (x) Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker