Share via


AFX_GLOBAL_DATA::GetColor

Retrieves the current color of the specified user interface element.

COLORREF GetColor(
   int nColor
);

Parameters

  • [in] nColor
    A value that specifies a user interface element whose color is retrieved. For a list of valid values, see the nIndex parameter of the GetSysColor method.

Return Value

The RGB color value of the specified user interface element. For more information, see Remarks.

Remarks

If the nColor parameter is out of range, the return value is zero. Because zero is also a valid RGB value, you cannot use this method to determine whether a system color is supported by the current operating system. Instead, use the GetSysColorBrush method, which returns NULL if the color is not supported.

Requirements

Header: afxglobals.h

See Also

Reference

AFX_GLOBAL_DATA Structure

Hierarchy Chart

GetSysColor Function

COLORREF

GetSysColorBrush