ListView_GetStringWidth
This macro determines the width of a specified string, using the specified list view controls current font. You can use this macro or send the LVM_GETSTRINGWIDTH message explicitly.
int ListView_GetStringWidth(
HWND hwnd,
LPCSTR psz );
Parameters
- hwnd
Handle to the list view control. - psz
Pointer to a null-terminated string.
Return Values
The string width indicates success. Zero indicates failure.
Remarks
The ListView_GetStringWidth macro returns the exact width, in pixels, of the specified string. If you use the returned string width as the column width in a call to the ListView_SetColumnWidth macro, the string will be truncated. To get the column width that can contain the string without truncating it, you must add padding to the returned string width.
Related message: LVM_GETSTRINGWIDTH
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Commctrl.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.