MSDN Library


Windows Mobile 6.5
A version of this page is also available for

This function sets the text color of the specified device context to the specified color.

COLORREF SetTextColor(
  HDC hdc, 
  COLORREF crColor


[in] Handle to the device context.


[in] Value of type COLORREF that specifies the color of the text.

A color reference for the previous text color indicates success. CLR_INVALID indicates failure. To get extended error information, call GetLastError.

The ExtTextOut function uses the text color to draw the face of each character that ExtTextOut writes. The text color is also used when converting bitmaps from color to monochrome and vice versa.

Windows Embedded CEWindows CE .NET 4.0 and later
Windows MobilePocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

Community Additions

© 2016 Microsoft