GetCharWidth32

This function retrieves the widths, in logical coordinates, of consecutive characters in a specified range from the current font.

WINGDIAPI BOOL WINAPI GetCharWidth32(
  HDC hdc,
  UINT iFirstChar,
  UINT iLastChar,
  LPINT lpBuffer
);

Parameters

  • hdc
    [in] Handle to the device context.
  • iFirstChar
    [in] Unsigned integer that specifies the first character in the group of consecutive characters.
  • iLastChar
    [in] Unsigned integer that specifies the last character in the group of consecutive characters. This last character must not precede the first character that you specified in iFirstChar.
  • lpBuffer
    [out] Pointer to a buffer that receives the character widths, in logical coordinates.

Return Values

A nonzero value indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The range of characters that you establish by setting iFirstChar and iLastChar is inclusive; that is, the returned widths include the widths of the characters specified by iFirstChar and iLastChar.

If a character does not exist in the current font, GetCharWidth32 assigns the width of the default character to that character.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.