windows_programming_notes.nbk: Home | Index | Next Page: Edit Control Default Message Processing | Previous Page: DRAWITEMSTRUCT


 DrawText

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

To specify additional formatting options, use the DrawTextEx function.

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
);

Parameters

Compare with DT_END_ELLIPSIS and DT_WORD_ELLIPSIS.

Return Values If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from lpRect->top to the bottom of the drawn text

If the function fails, the return value is zero.

Windows NT/2000 or later: To get extended error information, call GetLastError.

Remarks

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: Edit Control Default Message Processing | Previous Page: DRAWITEMSTRUCT


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time