Export (0) Print
Expand All

GetTextExtentPoint32Wrap function

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

Computes the width and height of the specified string of text. This function wraps a call to GetTextExtentPoint.


BOOL GetTextExtentPoint32Wrap(
  _In_   HDC hdc,
  _In_   LPCTSTR lpString,
  _In_   UINT cbCount,
  _Out_  LPSIZE lpSize


hdc [in]

Type: HDC

A handle to the device context.

lpString [in]


A pointer to a buffer that contains the text to be drawn. The string does not need to be zero-terminated, since cbCount specifies the length of the string.

cbCount [in]

Type: UINT

The length, in bytes, of the string pointed to by lpString.

Windows 95/98/Me: The maximum value for this parameter is 8192.

lpSize [out]


When this method returns, contains a pointer to a SIZE structure containing the dimensions of the string, in logical units.

Return value

Type: BOOL

Returns a nonzero value if successful; otherwise, 0.

To get extended error information, call GetLastError.


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

For additional remarks, please see GetTextExtentPoint.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Comctl32.dll (version 5.81 or later)



Community Additions

© 2014 Microsoft