LM QUERYSELECTION
Appearance
This message is used to enumerate the selected item, or items, in a list box.
Syntax
param1 SHORT sItemStart; /* Index of the start item. */ param2 ULONG ulReserved; /* Reserved value, should be 0. */
Parameters
- sItemStart (SHORT) - input
- Index of the start item.
- If the list box allows multiple selected items (LS_MULTIPLESEL style), this parameter indicates the index of the item from which the search for the next selected item is to begin. To get all selected items, send this message repeatedly, each time setting this parameter to the index returned by the previous call.
- If set to LIT_CURSOR, the index of the item with the current cursor is returned.
- If the list box allows only single selection, this parameter is ignored.
- LIT_CURSOR: Return the index of the item in the list box which currently has the cursor.
- LIT_FIRST: Start the search at the first item.
- Other: Start the search after the item specified by this index.
- ulReserved (ULONG) - input
- Reserved value, should be 0.
Returns
- sItemSelected (SHORT) - returns
- Index of the selected item.
- LIT_NONE: No selected item. For a single selection list box, this means no item is selected. For a multiple selection list box, this means no selected item has an index higher than sItemStart.
- Other: Index of the selected item. For a single selection list box, this is the index of the selected item. For a multiple selection list box, this is the index of the next selected item with an index higher than sItemStart.
- If sItemStart is LIT_CURSOR, the index of the list-box item with the cursor is returned.
Remarks
The list box control window procedure responds to this message by returning in sItemSelected the zero-based index of the selected item or the next selected item after sItemStart, if any.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it, other than set sItemSelected to the default value of 0.