GetSysColor

2.x

  COLORREF GetSysColor(nDspElement)    
  int nDspElement; /* display element, */  

The GetSysColor function retrieves the current color of the specified display element. Display elements are the various parts of a window and the Windows display that appear on the system screen.

Parameters

nDspElement

Specifies the display element whose color is to be retrieved. This parameter can be one of the following values:

Value Meaning

COLOR_ACTIVEBORDER Active window border.
COLOR_ACTIVECAPTION Active window title.
COLOR_APPWORKSPACE Background color of multiple document interface (MDI) applications.
COLOR_BACKGROUND Desktop.
COLOR_BTNFACE Face shading on push buttons.
COLOR_BTNHIGHLIGHT Selected button in a control.
COLOR_BTNSHADOW Edge shading on push buttons.
COLOR_BTNTEXT Text on push buttons.
COLOR_CAPTIONTEXT Text in title bar, size button, scroll-bar arrow button.
COLOR_GRAYTEXT Grayed (dimmed) text. This color is zero if the current display driver does not support a solid gray color.
COLOR_HIGHLIGHT Background of selected item in a control.
COLOR_HIGHLIGHTTEXT Text of selected item in a control.
COLOR_INACTIVEBORDER Inactive window border.
COLOR_INACTIVECAPTION Inactive window title.
COLOR_INACTIVECAPTIONTEXT Color of text in an inactive title.
COLOR_MENU Menu background.
COLOR_MENUTEXT Text in menus.
COLOR_SCROLLBAR Scroll-bar gray area.
COLOR_WINDOW Window background.
COLOR_WINDOWFRAME Window frame.
COLOR_WINDOWTEXT Text in windows.

Return Value

The return value is a red, green, blue (RGB) color value for the specified display element, if the function is successful.

Comments

An application can use the GetRValue, GetGValue, and GetBValue macros to extract the various colors from the return value.

See Also

GetSystemMetrics, SetSysColors