ExtTextOut

Syntax

BOOL ExtTextOut(hDC,X,Y,wOptions,lpRect,lpString,nCount,lpDx)

This function writes a character string, within a rectangular region on the specified display, using the currently selected font. The rectangular region can be opaque (filled with the current background color) and it can be a clipping region.

Parameter Type/Description  

hDC HDC Identifies the device context.  
X int Specifies the logical x-coordinate of the origin of the character cell for the first character in the specified string.  
Y int Specifies the logical y-coordinate of the origin of the character cell for the first character in the specified string.  
wOptions WORD Specifies the rectangle type. It can be one or both of the following values, or neither:  
  ETO_CLIPPED ETO_OPAQUE  
  The ETO_CLIPPED value specifies that Windows will clip text to the rectangle. The ETO_OPAQUE value specifies that the current background color fills the rectangle.  
lpRect LPRECT Points to a RECT data structure. The lpRect parameter can be NULL.  
lpString LPSTR Points to the specified character string.  
nCount int Specifies the number of characters in the string.  
lpDx LPINT Points to an array of values that indicate the distance between origins of adjacent character cells. For instance, lpDx[i] logical units will separate the origins of character cell i and character cell i + 1.  

Return Value

The return value specifies whether or not the string is drawn. It is nonzero if the string is drawn. Otherwise, it is zero.

Comments

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 wFlags 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.