GetTextColor

The GetTextColor function retrieves the current text color for the specified device context.

COLORREF GetTextColor(
  HDC hdc   // handle to device context
);
 

Parameters

hdc
Handle to the device context.

Return Values

If the function succeeds, the return value is the current text color as a COLORREF value.

If the function fails, the return value is CLR_INVALID.

Remarks

The text color defines the foreground color of characters drawn by using the TextOut or ExtTextOut function.

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

Fonts and Text Overview, Font and Text Functions, ExtTextOut, SetTextColor, TextOut