LB_GETCARETINDEX

3.1

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

An application sends an LB_GETCARETINDEX message to determine the index of the item that has the focus rectangle in a multiple-selection list box. The item may or may not be selected.

Parameters

This message has no parameters.

Return Value

The return value is the zero-based index of the item that has the focus rectangle in a list box. If the list box is a single-selection list box, the return value is the index of the item that is selected, if any.

Example

This example sends an LB_GETCARETINDEX message to retrieve the index of the item that has the focus rectangle in the list box:

LRESULT lrIndex;

lrIndex = SendDlgItemMessage(hdlg, ID_MYLISTBOX,
    LB_GETCARETINDEX, 0, 0L);

See Also

LB_SETCARETINDEX