This message adds a string to the list box of a combo box. If the list box is not sorted, the string is added to the end of the list. If the list box is sorted, the string is inserted into the list after sorting.
This message removes any existing list-box selections.
Parameter |
Description |
wParam |
Is not used. |
|
lParam |
Points to the null-terminated string that is to be added. If the combo box was created with an owner-draw style but without the CBS_HASSTRINGS style, the lParam parameter is an application-supplied 32-bit value that is stored by the combo box instead of the pointer to the string. |
The return value is the index to the string in the list box. The return value is CB_ERR if an error occurs; the return value is CB_ERRSPACE if insufficient space is available to store the new string.
If an owner-draw combo box was created with the CBS_SORT style but not the CBS_HASSTRINGS style, the WM_COMPAREITEM message is sent one or more times to the owner of the combo box so that the new item can be properly placed in the list box.