LB_SETCARETINDEX
wParam = (WPARAM) index; /* item index */
lParam = MAKELPARAM(fScroll, 0); /* flag for scrolling item */
An application sends an LB_SETCARETINDEX message to set the focus rectangle to the item at the specified index in a multiple-selection list box. If the item is not visible, it is scrolled into view.
index
Value of wParam. Specifies the zero-based index of the item to receive the focus rectangle in the list box.
fScroll
Value of lParam. If this value is zero, the item is scrolled until it is fully visible. If this value is nonzero, the item is scrolled until it is at least partially visible.
The return value is LB_ERR if an error occurs.
This example sends an LB_SETCARETINDEX message to set the focus rectangle to an item in a list box:
WPARAM wIndex;
wIndex = 0; /* set index to first item */
SendDlgItemMessage(hdlg, ID_MYLISTBOX, LB_SETCARETINDEX,
wIndex, 0L);