LB_GETTEXTLEN

2.x

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.

Parameters

index

Value of wParam. Specifies the zero-based index of the string.

Return Value

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.

Example

This example retrieves the length of the first item in the list box:

DWORD cbItemString;

cbItemString = SendDlgItemMessage(hdlg, ID_MYLISTBOX,
    LB_GETTEXTLEN, 0, 0L);

See Also

LB_GETTEXT