LB_SETSEL message

Selects an item in a multiple-selection list box and, if necessary, scrolls the item into view.

Parameters

wParam

Specifies how to set the selection. If this parameter is TRUE, the item is selected and highlighted; if it is FALSE, the highlight is removed and the item is no longer selected.

lParam

Specifies the zero-based index of the item to set. If this parameter is -1, the selection is added to or removed from all items, depending on the value of wParam, and no scrolling occurs.

Return value

If an error occurs, the return value is LB_ERR.

Remarks

Use this message only with multiple-selection list boxes.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

LB_GETSEL

LB_SELITEMRANGE