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 Version | dwmapi.dll |
|---|
| Header | dwmapi.h |
|---|
| Import library | dwmapi.lib |
|---|
| Minimum operating systems |
Windows Vista |
|---|
See Also
Enable and Control DWM Composition