The GetCharWidth32 function retrieves the widths, in logical coordinates, of consecutive characters in a specified range from the current font.
BOOL GetCharWidth32(
HDC hdc, |
// handle of device context |
UINT iFirstChar, |
// first character in range to query |
UINT iLastChar, |
// last character in range to query |
LPINT lpBuffer |
// address of buffer for widths |
); |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The range is inclusive; that is, the returned widths include the widths of the characters specified by the iFirstChar and iLastChar parameters.
If a character does not exist in the current font, it is assigned the width of the default character.