Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 1.62 KB

File metadata and controls

67 lines (45 loc) · 1.62 KB

Home

Function name : GetTextExtentPoint32

Group: Font and Text - Library: gdi32


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


Code examples:

Vertical Label control

Declaration:

BOOL GetTextExtentPoint32(
  HDC hdc,           // handle to DC
  LPCTSTR lpString,  // text string
  int cbString,      // characters in string
  LPSIZE lpSize      // string size
);  

FoxPro declaration:

DECLARE INTEGER GetTextExtentPoint32 IN gdi32;
	INTEGER   hdc,;
	STRING    lpString,;
	INTEGER   cbString,;
	STRING  @ lpSize
  

Parameters:

hdc [in] Handle to the device context.

lpString [in] Pointer to a buffer that specifies the text string.

cbString [in] Specifies the length of the lpString buffer. For the ANSI function it is a BYTE count and for the Unicode function it is a WORD count.

lpSize [out] Pointer to a SIZE structure that receives the dimensions of the string, in logical units.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

The string does not need to be zero-terminated, because the cbString parameter specifies the length of the string.

See also: GdipMeasureString, TXTWIDTH(), WFONT( )