LB_SETCURSEL

This message selects a string and scrolls it into view, if necessary. When the new string is selected, the list box removes the highlight from the previously selected string.

Parameter Description  

wParam Contains the index of the string that is selected. If wParam is –1, the list box is set to have no selection.  
lParam Is not used.  

Return Value

The return value is LB_ERR if an error occurs.

Comments

This message should be used only with single-selection list boxes. It cannot be used to set or remove a selection in a multiple-selection list box.