Formatting Text

Windows CE provides a complete set of functions to format and draw text in an application's client area and on a page of printer paper.

The default text color for a display device context is black; the default background color is white; and the default background mode is OPAQUE. Use the SetTextColor and GetTextColor functions to respectively set and retrieve the color of text drawn in the client-area of a window or printed by a color printer. Use the SetBkColor and GetBkColor functions to respectively set or retrieve the background color. Use the SetBkMode and the GetBkMode functions to respectively set or retrieve the background mode. The background mode specifies the logical method for combining the selected background color with the current colors on the video display.

You can use the GetTextExtentPoint32 function to compute the width and height of a string of text. You can use the GetTextMetrics function to retrieve a font's logical dimensions. You can call the GetDeviceCaps function to determine the dimensions of an output device.