DwmGetColorizationColor function (dwmapi.h)
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 DwmGetColorizationColor(
[out] DWORD *pcrColorization,
[out] BOOL *pfOpaqueBlend
);
Parameters
[out] pcrColorization
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.
[out] pfOpaqueBlend
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
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | dwmapi.h |
Library | Dwmapi.lib |
DLL | Dwmapi.dll |