ListView_GetStringWidthListView_GetStringWidth*
*Contents  *Index  *Topic Contents
*Previous Topic: ListView_GetSelectionMark
*Next Topic: ListView_GetSubItemRect

ListView_GetStringWidth


int ListView_GetStringWidth(
    HWND hwnd, 		
    LPCSTR psz		
);		

Determines the width of a specified string using the specified list view control's current font. You can use this macro or send the LVM_GETSTRINGWIDTH message explicitly.

hwnd
Handle to the list view control.
psz
Address of a null-terminated string.

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.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.