LB_GETTEXTLEN
wParam = (WPARAM) index; /* item index */
lParam = 0L; /* not used, must be zero */
An application sends an LB_GETTEXTLEN message to retrieve the length of a string in a list box.
index
Value of wParam. Specifies the zero-based index of the string.
The return value is the length of the string, in bytes, excluding the terminating null character. The return value is LB_ERR if the index parameter does not specify a valid index.
This example retrieves the length of the first item in the list box:
DWORD cbItemString;
cbItemString = SendDlgItemMessage(hdlg, ID_MYLISTBOX,
LB_GETTEXTLEN, 0, 0L);