| Previous | Next |
| ERROR_HOOK_NOT_INSTALLED | ERROR_SETCOUNT_ON_BAD_LB |
ERROR_INVALID_LB_MESSAGE
The message does not apply to a single-selection list box
List-box styles determine whether the control supports one selected item or multiple selected items. The LBS_MULTIPLESEL and LBS_EXTENDEDSEL styles enable multi-selection behavior; without them, the list box is single-selection.
Messages designed to manipulate multi-selection state are not interchangeable with ordinary current-selection messages. A valid list-box HWND can therefore reject a message because the control was created with the wrong selection model for that operation.
What to check
- Read the actual
LBS_*styles from the created control or dialog resource. - Use
LB_GETCURSEL/LB_SETCURSELfor a single-selection control. - Use the documented multi-selection messages only with the corresponding styles.
- If the product requirement changed, recreate or redefine the control with the intended selection model.
This is different from ERROR_WINDOW_NOT_COMBOBOX or an invalid handle: the target is a list box, but its selection style makes the message invalid.
References
Looking for a different code? Search another status or error code.