Events
Nov 19, 11 PM - Nov 21, 11 PM
Gain the competitive edge you need with powerful AI and Cloud solutions by attending Microsoft Ignite online.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The SetTextColor function sets the text color for the specified device context to the specified color.
COLORREF SetTextColor(
[in] HDC hdc,
[in] COLORREF color
);
[in] hdc
A handle to the device context.
[in] color
The color of the text.
If the function succeeds, the return value is a color reference for the previous text color as a COLORREF value.
If the function fails, the return value is CLR_INVALID.
The text color is used to draw the face of each character written by the TextOut and ExtTextOut functions. The text color is also used in converting bitmaps from color to monochrome and vice versa.
For an example, see "Setting Fonts for Menu-Item Text Strings" in Using Menus.
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 |
Events
Nov 19, 11 PM - Nov 21, 11 PM
Gain the competitive edge you need with powerful AI and Cloud solutions by attending Microsoft Ignite online.
Register now