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.
This message has no parameters.
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.
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);