GetTextColor function (wingdi.h)

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

Syntax

COLORREF GetTextColor(
  [in] HDC hdc
);

Parameters

[in] hdc

Handle to the device context.

Return value

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. No extended error information is available.

Remarks

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

COLORREF

ExtTextOut

Font and Text Functions

Fonts and Text Overview

SetTextColor

TextOut