Skip to content

Latest commit

 

History

History
122 lines (81 loc) · 4.57 KB

nf-wingdi-gettextextentpointw.md

File metadata and controls

122 lines (81 loc) · 4.57 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wingdi.GetTextExtentPointW
GetTextExtentPointW function (wingdi.h)
The GetTextExtentPoint function computes the width and height of the specified string of text. (Unicode)
GetTextExtentPoint
GetTextExtentPoint function [Windows GDI]
GetTextExtentPointW
_win32_GetTextExtentPoint
gdi.gettextextentpoint
wingdi/GetTextExtentPoint
wingdi/GetTextExtentPointW
gdi\gettextextentpoint.htm
gdi
731085ce-009d-42e1-885f-2f5151e0f6d3
12/05/2018
GetTextExtentPoint, GetTextExtentPoint function [Windows GDI], GetTextExtentPointA, GetTextExtentPointW, _win32_GetTextExtentPoint, gdi.gettextextentpoint, wingdi/GetTextExtentPoint, wingdi/GetTextExtentPointA, wingdi/GetTextExtentPointW
wingdi.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
GetTextExtentPointW (Unicode) and GetTextExtentPointA (ANSI)
Gdi32.lib
Gdi32.dll
Windows
19H1
GetTextExtentPointW
wingdi/GetTextExtentPointW
c++
APIRef
kbSyntax
DllExport
Gdi32.dll
ext-ms-win-gdi-font-l1-1-2.dll
Ext-MS-Win-GDI-Font-L1-1-3.dll
Ext-MS-Win-GDI-Internal-Desktop-L1-1-0.dll
GDI32Full.dll
GetTextExtentPoint
GetTextExtentPointA
GetTextExtentPointW

GetTextExtentPointW function

-description

The GetTextExtentPoint function computes the width and height of the specified string of text.

Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should call the GetTextExtentPoint32 function, which provides more accurate results.
 

-parameters

-param hdc [in]

A handle to the device context.

-param lpString [in]

A pointer to the string that specifies the text. The string does not need to be zero-terminated, since cbString specifies the length of the string.

-param c [in]

The length of the string pointed to by lpString.

-param lpsz [out]

A pointer to a SIZE structure that receives the dimensions of the string, in logical units.

-returns

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

-remarks

The GetTextExtentPoint function uses the currently selected font to compute the dimensions of the string. The width and height, in logical units, are computed without considering any clipping. Also, this function assumes that the text is horizontal, that is, that the escapement is always 0. This is true for both the horizontal and vertical measurements of the text. Even if using a font specifying a nonzero escapement, this function will not use the angle while computing the text extent. The application must convert it explicitly.

Because some devices kern characters, the sum of the extents of the characters in a string may not be equal to the extent of the string.

The calculated string width takes into account the intercharacter spacing set by the SetTextCharacterExtra function.

Note

The wingdi.h header defines GetTextExtentPoint as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Font and Text Functions

Fonts and Text Overview

GetTextExtentPoint32

SIZE

SetTextCharacterExtra