LB_GETTEXT

An application sends an LB_GETTEXT message to get a string from a list box.

Parameters

wParam

Specifies the zero-based index of the string to retrieve.

lParam

Points to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. The size of the string can be determined ahead of time by sending a LB_GETTEXTLEN message.

Return Value

The return value is the length (in bytes) of the string, excluding the terminating null character. If wParam does not specify a valid index, the return value is CB_ERR.

Comments

If the list box was created with an owner-draw style but without the LBS_HASSTRINGS style, the buffer pointed to by the lParam parameter of the message receives the 32-bit value associated with the item.

The LB_GETTEXT message may be used as either a wide-character message (where text arguments must use Unicode) or an ANSI message (where text arguments must use characters from the Windows 3.x character set installed).

See Also

LB_GETTEXTLEN