LB_GETCOUNT

2.x

LB_GETCOUNT
wParam = 0;     /* not used, must be zero */
lParam = 0L;    /* not used, must be zero */

An application sends an LB_GETCOUNT message to retrieve the number of items in a list box.

Parameters

This message has no parameters.

Return Value

The return value is the number of items in the list box, or it is LB_ERR if an error occurs.

Comments

The returned count is one greater than the index value of the last item (the index is zero-based).

Example

This example retrieves the number of items in a list box:

DWORD cListItems;

cListItems = SendDlgItemMessage(hdlg, ID_MYLISTBOX, LB_GETCOUNT, 0, 0);