HeaderPane
Main
Hide
Share Link
Print

FindStringEx

Searches cells for a string.

C

LONG WINAPI SftBox_FindStringEx(HWND hwndCtl, LONG index, int realCol, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact);

C++

LONG CSftBox::FindStringEx(LONG index, int realCol, LPCTSTR lpszText, BOOL fWrap, BOOL fIgnoreCase, BOOL fExact) const;

Parameters

hwndCtl

The window handle of the combo box control.

index

The zero-based item index after which the search begins (non-inclusive). If -1 is specified, the search starts at the first item (index 0).

realCol

The zero-based column number. The cell text for cells in this column is searched. If -1 is specified, all columns are searched.

lpszText

The text to search.

fWrap

If set to TRUE, the search starts after index, wraps around to the first item (if necessary) and ends with item index, otherwise the search does not wrap around and ends at the last item, so no item is searched if index is the last item. This parameter is ignored if index is -1.

fIgnoreCase

If set to TRUE, the string comparison between cell text and lpszText is not case sensitive. If FALSE, comparison is case sensitive.

fExact

If set to TRUE, the cell text must be exactly the same as lpszText, otherwise the cell text must start with the string lpszText.

Returns

The return value is the zero-based index of the item where the string was found. -1 is returned if the string was not found or an error occurred.

Comments

The FindStringEx function searches cells for a string.

FindString, FindStringCase, FindStringExact and FindStringExactCase offer the same search with predefined values for fIgnoreCase and fExact.

The strings are compared using the locale defined using SetLocale.

If only enabled items can be selected (see SFTBOX_CONTROL, fSelectEnabledItemsOnly), disabled items are not searched.

In a combo box control using a virtual data source, this function cannot be used and -1 is returned.

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.