TextOut

Syntax

BOOL TextOut(hDC,X,Y,lpString,nCount)

This function writes a character string on the specified display, using the currently selected font. The starting position of the string is given by the X and Y parameters.

Parameter Type/Description  

hDC HDC Identifies the device context.  
X int Specifies the logical x-coordinate of the starting point of the string.  
Y int Specifies the logical y-coordinate of the starting point of the string.  
lpString LPSTR Points to the character string that is to be drawn.  
nCount int Specifies the number of characters in the string.  

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

Character origins are defined to be at 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 TextOut for a given device context. When this flag is set, Windows ignores the X and Y parameters on subsequent TextOut calls.