HeaderPane
Main
Hide
Share Link
Print

ItemIndex

Returns an item's index given an item ID.

C

int WINAPI SftBox_GetItemIndex(HWND hwndCtl, SFTBOX_ID id);

C++

int CSftBox::GetItemIndex(SFTBOX_ID id) const;

Parameters

hwndCtl

The window handle of the combo box control.

id

The item ID of the item for which the zero-based index is to be retrieved. The item ID was obtained using GetItemID.

Returns

GetItemIndex returns the zero-based index of the item with the specified item ID. -1 is returned if no item with the specified item ID exists.

Comments

The GetItemIndex function returns an item's index given an item ID.

The item ID returned by GetItemID does not change throughout the lifetime of an item. Even if an item changes its index position because other items are deleted or inserted, the item ID remains constant. The item index describes the zero-based position of an item in a combo box control.

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

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


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