ExtTextOut

  BOOL ExtTextOut(hdc, X, Y, fOptions, lprc, lpString, nCount, lpDx)    
  HDC hdc;    
  int X;    
  int Y;    
  UINT fOptions;    
  CONST RECT *lprc;    
  LPCTSTR lpString;    
  UINT nCount;    
  LPINT lpDx;    

The ExtTextOut function writes a character string using the currently selected font. A rectangle may be provided, to be used for clipping, opaquing, or both.

Parameters

hdc

Identifies the device context.

X

Specifies the logical x-coordinate of the reference point.

Y

Specifies the logical y-coordinate of the reference point. How the text is positioned relative to this reference point depends on the mode set with SetTextAlign. The default mode places the upper left corner of the first character cell at the reference point.

fOptions

Specifies how to use the rectangle. Any combination of the following bits may be set:

Value Meaning

ETO_CLIPPED Specifies that the text will be clipped to the rectangle.
ETO_OPAQUE Specifies that the current background color fills the rectangle.

lprc

Points to a RECT structure. The lprc parameter may be NULL.

lpString

Points to the specified character string.

nCount

Specifies the number of characters in the string.

lpDx

Points to an array of values that indicate the distance between origins of adjacent character cells. For example, lpDx[i] logical units will separate the origins of character cell i and character cell i + 1.

Return Value

The return value is TRUE if the string is drawn. Otherwise, it is FALSE.

Comments

The ExtTextOut function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set).

If lpDx is NULL, the function uses the default spacing between characters.

The character-cell origins and the contents of the array pointed to by the lpDx parameter are given in logical units. A character-cell origin is defined as the upper-left corner of the character cell.

By default, the current position is not used or updated by this function. However, an application can call the SetTextAlign function with the fMode parameter set to TA_UPDATECP to permit Windows to use and update the current position each time the application calls ExtTextOut for a given device context. When this flag is set, Windows ignores the X and Y parameters on subsequent ExtTextOut calls.

See Also

SetTextAlign