Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A version of this page is also available for
4/8/2010
This function computes the width and height of the specified string of text.
BOOL GetTextExtentPoint(
HDC hdc,
LPCTSTR lpString,
int cbString,
LPSIZE lpSize
);
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
The GetTextExtentPoint function uses the currently selected font to compute the dimensions of the string. GetTextExtentPoint computes the width and height, in logical units, without considering any clipping.
Because some devices kern characters, the sum of the extents of the characters in a string does not always equal to the extent of the string.
The GetTextExtentPoint function is identical to the GetTextExtentPoint32 function.
Header | windows.h |
Library | coredll.lib |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Please sign in to use this experience.
Sign in