DrawTextExPrivWrap function

[DrawTextExPrivWrap is available through Windows XP with Service Pack 2 (SP2). It might be altered or unavailable in subsequent versions. It is recommended to use DrawTextEx directly instead.]

Draws formatted text in the specified rectangle. This function wraps a call to DrawTextEx.


int WINAPI DrawTextExPrivWrap(
  _In_    HDC              hdc,
  _Inout_ LPTSTR           lpchText,
  _In_    int              cchText,
  _Inout_ LPRECT           lprc,
  _In_    UINT             dwDTFormat,


hdc [in]

Type: HDC

A handle to the device context in which to draw.

lpchText [in, out]


A pointer to a buffer that contains the text to draw. If the cchText parameter is -1, the string must be null-terminated.

If dwDTFormat includes DT_MODIFYSTRING, the function might add up to four additional characters to this string. The buffer that contains the string should be large enough to accommodate these extra characters.

cchText [in]

Type: int

The length of the string pointed to by lpchText. If cchText is -1, then the lpchText parameter is assumed to be a pointer to a null-terminated string and DrawTextEx computes the character count automatically.

lprc [in, out]


A pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the text is to be formatted.

dwDTFormat [in]

Type: UINT

The formatting options. See the documentation for DrawTextEx for a complete list of options.

lpDTParams [in]


A pointer to a DRAWTEXTPARAMS structure that specifies additional formatting options. This parameter can be NULL.

Return value

Type: int

If the function succeeds, the return value is the text height in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from the top member of lprc to the bottom of the drawn text.

If the function fails, the return value is zero.

To get extended error information, call GetLastError.


DrawTextExPrivWrap is not exported by name or declared in a public header file. To use it, you must use GetProcAddress and request ordinal 416 from ComCtl32.dll to obtain a function pointer.

For additional remarks, please see DrawTextEx.


Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Comctl32.dll (version 6.0 or later)