CB_SELECTSTRING

Version 3.0

This message selects the first string in the list box of a combo box that matches the specified prefix. The text in the edit control of the combo box is changed to reflect the new selection.

Parameter

Description

 

wParam

Contains the index of the item before the first item to be searched. When the search reaches the bottom of the list box it continues from the top of the list box back to the item specified by wParam. If the wParam parameter is –1, the entire list box is searched from the beginning.

 

lParam

Points to the prefix string. The string must have a null-terminating character.

 

Return Value

The return value is the index of the newly selected item. If the search was unsuccessful, the return value is CB_ERR and the current selection is not changed.

Comments

A string is selected only if its initial characters (from the starting point) match the characters in the prefix string.

If the combo box was created with an owner-draw style but without the CBS_HASSTRINGS style, this message returns the index of the item whose long value (supplied as the lParam parameter of the CB_ADDSTRING or CB_INSERTSTRING message) matches the value supplied as the lParam parameter of CB_FINDSTRING.