Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 1.75 KB

DrawText.md

File metadata and controls

72 lines (50 loc) · 1.75 KB

Home

Function name : DrawText

Group: Font and Text - Library: user32


The DrawText function draws formatted text in the specified rectangle. It formats the text according to the specified method (expanding tabs, justifying characters, breaking lines, and so forth).


Code examples:

Using the DrawText function
Subclassing CommandButton control to create BackColor property
Placing On-screen Alert on top of all windows

Declaration:

int DrawText(
  HDC hDC,          // handle to DC
  LPCTSTR lpString, // text to draw
  int nCount,       // text length
  LPRECT lpRect,    // formatting dimensions
  UINT uFormat      // text-drawing options
);  

FoxPro declaration:

DECLARE INTEGER DrawText IN user32;
	INTEGER   hDC,;
	STRING    lpString,;
	INTEGER   nCount,;
	STRING  @ lpRect,;
	INTEGER   uFormat  

Parameters:

hDC [in] Handle to the device context.

lpString [in] Pointer to the string that specifies the text to be drawn.

nCount [in] Specifies the length of the string.

lpRect [in/out] Pointer to a RECT structure that contains the rectangle (in logical coordinates) in which the text is to be formatted.

uFormat [in] Specifies the method of formatting the text.


Return value:

If the function succeeds, the return value is the height of the text in logical units. If the function fails, the return value is zero.


Comments:

See also: TextOut, CreateFont.