- nIndex
-
The display element whose color is to be retrieved. This parameter can be one of the following values.
Value Meaning COLOR_3DDKSHADOW
21Dark shadow for three-dimensional display elements.
COLOR_3DFACE
15Face color for three-dimensional display elements and for dialog box backgrounds.
COLOR_3DHIGHLIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DHILIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DLIGHT
22Light color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DSHADOW
16Shadow color for three-dimensional display elements (for edges facing away from the light source).
COLOR_ACTIVEBORDER
10Active window border.
COLOR_ACTIVECAPTION
2Active window title bar.
Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled.
COLOR_APPWORKSPACE
12Background color of multiple document interface (MDI) applications.
COLOR_BACKGROUND
1Desktop.
COLOR_BTNFACE
15Face color for three-dimensional display elements and for dialog box backgrounds.
COLOR_BTNHIGHLIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_BTNHILIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_BTNSHADOW
16Shadow color for three-dimensional display elements (for edges facing away from the light source).
COLOR_BTNTEXT
18Text on push buttons.
COLOR_CAPTIONTEXT
9Text in caption, size box, and scroll bar arrow box.
COLOR_DESKTOP
1Desktop.
COLOR_GRADIENTACTIVECAPTION
27Right side color in the color gradient of an active window's title bar. COLOR_ACTIVECAPTION specifies the left side color. Use SPI_GETGRADIENTCAPTIONS with the SystemParametersInfo function to determine whether the gradient effect is enabled.
COLOR_GRADIENTINACTIVECAPTION
28Right side color in the color gradient of an inactive window's title bar. COLOR_INACTIVECAPTION specifies the left side color.
COLOR_GRAYTEXT
17Grayed (disabled) text. This color is set to 0 if the current display driver does not support a solid gray color.
COLOR_HIGHLIGHT
13Item(s) selected in a control.
COLOR_HIGHLIGHTTEXT
14Text of item(s) selected in a control.
COLOR_HOTLIGHT
26Color for a hyperlink or hot-tracked item.
COLOR_INACTIVEBORDER
11Inactive window border.
COLOR_INACTIVECAPTION
3Inactive window caption.
Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled.
COLOR_INACTIVECAPTIONTEXT
19Color of text in an inactive caption.
COLOR_INFOBK
24Background color for tooltip controls.
COLOR_INFOTEXT
23Text color for tooltip controls.
COLOR_MENU
4Menu background.
COLOR_MENUHILIGHT
29The color used to highlight menu items when the menu appears as a flat menu (see SystemParametersInfo). The highlighted menu item is outlined with COLOR_HIGHLIGHT.
Windows 2000: This value is not supported.
COLOR_MENUBAR
30The background color for the menu bar when menus appear as flat menus (see SystemParametersInfo). However, COLOR_MENU continues to specify the background color of the menu popup.
Windows 2000: This value is not supported.
COLOR_MENUTEXT
7Text in menus.
COLOR_SCROLLBAR
0Scroll bar gray area.
COLOR_WINDOW
5Window background.
COLOR_WINDOWFRAME
6Window frame.
COLOR_WINDOWTEXT
8Text in windows.
Return Value
The function returns the red, green, blue (RGB) color value of the given element.
If the nIndex parameter is out of range, the return value is zero. Because zero is also a valid RGB value, you cannot use GetSysColor to determine whether a system color is supported by the current platform. Instead, use the
Remarks
To display the component of the RGB value, use the
System colors for monochrome displays are usually interpreted as shades of gray.
To paint with a system color brush, an application should use GetSysColorBrush(nIndex)
, instead of CreateSolidBrush(GetSysColor(nIndex))
, because GetSysColorBrush returns a cached brush, instead of allocating a new one.