GetBkColor

The GetBkColor function returns the current background color for the specified device context.

COLORREF GetBkColor(
  HDC hdc   // handle of device context
);
 

Parameters

hdc
Handle to the device context whose background color is to be returned.

Return Values

If the function succeeds, the return value is a COLORREF value for the current background color.

If the function fails, the return value is CLR_INVALID.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Painting and Drawing Overview, Painting and Drawing Functions, GetBkMode, SetBkColor