DwmGetColorizationColor function
Applies to: desktop apps only
Retrieves the current color used for Desktop Window Manager (DWM) glass composition. This value is based on the current color scheme and can be modified by the user. Applications can listen for color changes by handling the WM_DWMCOLORIZATIONCOLORCHANGED notification.
Syntax
HRESULT WINAPI DwmGetColorizationColor( __out DWORD *pcrColorization, __out BOOL *pfOpaqueBlend );
Parameters
- pcrColorization [out]
-
A pointer to a value that, when this function returns successfully, receives the current color used for glass composition. The color format of the value is 0xAARRGGBB.
- pfOpaqueBlend [out]
-
A pointer to a value that, when this function returns successfully, indicates whether the color is an opaque blend. TRUE if the color is an opaque blend; otherwise, FALSE.
Return value
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The value pointed to by pcrColorization is in an 0xAARRGGBB format. Many Microsoft Win32 APIs, such as COLORREF, use a 0x00BBGGRR format. Be careful to assure that the intended colors are used.
Examples
The following example code shows a WM_DWMCOLORIZATIONCOLORCHANGED notification handle. If the colorization notification is received, this code retrieves the new color value.
...
DWORD color = 0;
BOOL opaque = FALSE;
HRESULT hr = DwmGetColorizationColor(&color, &opaque);
if (SUCCEEDED(hr))
{
// Update the application to use the new color.
}
...
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
Send comments about this topic to Microsoft
Build date: 2/14/2012
The "Enable and Control DWM Composition" MSDN page describes DwmGetColorizationColor as, "The colorization value is provided through the DWMAPIs to enable applications to match client UI with the system color theme."
DwmGetColorizationColor is documented to return a color in the 0xAARRGGBB format. With the Windows 7 bright green "Leaf" color scheme, DwmGetColorizationColor returns 0x0D0A0F04. When you look at this value it is a nearly completely transparent dark grey.
Either the documentation of what DwmGetColorizationColor returns in incorrect, it is returning the wrong value, or is not meant to be used by applications to enable the client UI to match the sytem color theme.
Please clarify.
There **is** the undocumented registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor. On Windows 7, with the "Leaf" color scheme key contains the value 0x8032cdcd. This is a half-transparent green - a valid value when one is using a "Leaf" color scheme.
Obviously i'd prefer not use an undocumented registry location to obtain the DWM colorization color.
- 10/3/2010
- Jack Tripper
- 5/19/2012
- Jack Tripper
The "Enable and Control DWM Composition" MSDN page describes DwmGetColorizationColor as, "The colorization value is provided through the DWMAPIs to enable applications to match client UI with the system color theme."
DwmGetColorizationColor is documented to return a color in the 0xAARRGGBB format. With the Windows 7 bright green "Leaf" color scheme, DwmGetColorizationColor returns 0x0D0A0F04. When you look at this value it is a nearly completely transparent dark grey.
Either the documentation of what DwmGetColorizationColor returns in incorrect, it is returning the wrong value, or is not meant to be used by applications to enable the client UI to match the sytem color theme.
Please clarify.
There **is** the undocumented registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor. On Windows 7, with the "Leaf" color scheme, key contains the value 0x8032cdcd. This is a half-transparent green - a valid value when one is using a "Leaf" color scheme.
Obviously i'd prefer not use an undocumented registry location to obtain the DWM colorization color.
- 11/28/2010
- Jack Tripper
- 5/19/2012
- Jack Tripper