GetSysColorBrush

The GetSysColorBrush function retrieves a handle identifying a logical brush that corresponds to the specified color index.

HBRUSH GetSysColorBrush(
  int nIndex  // system color index
);
 

Parameters

nIndex
Specifies a color index. This value corresponds to the color used to paint one of the 21 window elements.

Return Values

The return value identifies a logical brush.

Remarks

A brush is a bitmap that the system uses to paint the interiors of filled shapes. An application can retrieve the current system colors by calling the GetSysColor function. An application can set the current system colors by calling the SetSysColors function.

An application must not register a window class for a window using a system brush.

Windows CE: The values assigned to the COLOR_X flags in Windows CE are different from the values assigned to these flags in Windows desktop platforms. Therefore, you should specify the COLOR_X flag value, rather than the corresponding integer value, for the nIndex parameter.

QuickInfo

  Windows NT: Requires version 3.51 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Brushes Overview, Brush Functions, GetSysColor, SetSysColors