BCGControlBar Pro for MFC
int CBCGPToolBar::CommandToIndex ( UINT  nIDFind,
int  iIndexFirst = 0 
) const

Given a toolbar button's command ID returns the button's index.

Returns
Index of the toolbar button if success; it is -1 if there is no button with the specifies ID.

A CBCGPToolBar object maintains an internal list of its buttons. Each button has a command ID. Call this function to retrieve a button's index in the list by the button's command ID.

You can specify an index in the list to start from.

Parameters
nIDFindSpecifies the command ID.
iIndexFirstSpecifies the initial index to start from.