LM_SEARCHSTRING
Appearance
This message returns the index of the list box item whose text matches the string.
Syntax
param1 USHORT uscmd; /* Command. */ SHORT sItemStart; /* Index of the start item. */ param2 PSZ pszSearchString; /* Search string. */
Parameters
- uscmd (USHORT) - input
- Command.
- Defines the criteria by which the string specified by the pszSearchString
- parameter is to be compared with the text of the items, to determine the index of the
- first matching item.
- These values can be combined using the logical-OR operator:
- LSS_CASESENSITIVE: Matching occurs if the item contains the characters
- specified by the pszSearchString parameter exactly.
- This value is mandatory.
- LSS_PREFIX: Matching occurs if the leading characters of the item contain the
- characters specified by the pszSearchString parameter.
- If this value is specified, LSS_SUBSTRING must not be specified.
- LSS_SUBSTRING: Matching occurs if the item contains a substring of the
- characters specified by the pszSearchString parameter.
- If this value is specified, LSS_PREFIX must not be specified.
- LSS_CASESENSITIVE: Matching occurs if the item contains the characters
- sItemStart (SHORT) - input
- Index of the start item.
- LIT_FIRST: Start the search at the first item.
- Other: Start the search after the item specified by this index.
- pszSearchString (PSZ) - input
- Search string.
- This points to the string to search for.
Returns
- sItemMatched (SHORT) - return
- Index item whose text matches the string.
- LIT_ERROR: Error occurred.
- LIT_NONE: No item found.
- Other: Index item whose text matches the string.
Remarks
The list box control window procedure responds to this message by setting sItemMatched to the index of the next item whose text matches the string specified by pszSearchString.
All the items of the list are searched until a match is found, that is, the search wraps from the end to the start of the list.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it, other than to set sItemMatched to the default value of 0.