Skip to content

Latest commit

 

History

History
116 lines (77 loc) · 4.51 KB

nf-winuser-gettabbedtextextenta.md

File metadata and controls

116 lines (77 loc) · 4.51 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:winuser.GetTabbedTextExtentA
GetTabbedTextExtentA function (winuser.h)
The GetTabbedTextExtent function computes the width and height of a character string. (ANSI)
GetTabbedTextExtentA
winuser/GetTabbedTextExtentA
gdi\gettabbedtextextent.htm
gdi
3444bb8d-4a30-47d4-b211-01f7cba39975
12/05/2018
GetTabbedTextExtent, GetTabbedTextExtent function [Windows GDI], GetTabbedTextExtentA, GetTabbedTextExtentW, _win32_GetTabbedTextExtent, gdi.gettabbedtextextent, winuser/GetTabbedTextExtent, winuser/GetTabbedTextExtentA, winuser/GetTabbedTextExtentW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
GetTabbedTextExtentW (Unicode) and GetTabbedTextExtentA (ANSI)
User32.lib
User32.dll
Windows
19H1
GetTabbedTextExtentA
winuser/GetTabbedTextExtentA
c++
APIRef
kbSyntax
DllExport
user32.dll
GetTabbedTextExtent
GetTabbedTextExtentA
GetTabbedTextExtentW

GetTabbedTextExtentA function

-description

The GetTabbedTextExtent function computes the width and height of a character string. If the string contains one or more tab characters, the width of the string is based upon the specified tab stops. The GetTabbedTextExtent function uses the currently selected font to compute the dimensions of the string.

-parameters

-param hdc [in]

A handle to the device context.

-param lpString [in]

A pointer to a character string.

-param chCount [in]

The length of the text string. For the ANSI function it is a BYTE count and for the Unicode function it is a WORD count. Note that for the ANSI function, characters in SBCS code pages take one byte each, while most characters in DBCS code pages take two bytes; for the Unicode function, most currently defined Unicode characters (those in the Basic Multilingual Plane (BMP)) are one WORD while Unicode surrogates are two WORDs.

-param nTabPositions [in]

The number of tab-stop positions in the array pointed to by the lpnTabStopPositions parameter.

-param lpnTabStopPositions [in]

A pointer to an array containing the tab-stop positions, in device units. The tab stops must be sorted in increasing order; the smallest x-value should be the first item in the array.

-returns

If the function succeeds, the return value is the dimensions of the string in logical units. The height is in the high-order word and the width is in the low-order word.

If the function fails, the return value is 0. GetTabbedTextExtent will fail if hDC is invalid and if nTabPositions is less than 0.

-remarks

The current clipping region does not affect the width and height returned by the GetTabbedTextExtent function.

Because some devices do not place characters in regular cell arrays (that is, they kern the characters), the sum of the extents of the characters in a string may not be equal to the extent of the string.

If the nTabPositions parameter is zero and the lpnTabStopPositions parameter is NULL, tabs are expanded to eight times the average character width.

If nTabPositions is 1, the tab stops are separated by the distance specified by the first value in the array to which lpnTabStopPositions points.

Note

The winuser.h header defines GetTabbedTextExtent 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

TabbedTextOut