BCGControlBar Pro for MFC
void CBCGPToolbarCustomize::AddButton ( LPCTSTR  lpszCategory,
const CBCGPToolbarButton button,
int  iInsertAfter = -1 
)

Call this function to insert a toolbar button to the list box of commands on the "Command" page.

The AddButton function ignores buttons with the standard command IDs (like ID_FILE_MRU_FILE1, for example), non-permitted commands (see CBCGPToolBar::IsCommandPermitted) and dummy buttons.

This function creates a new CBCGPToolbarButton object using the runtime class of the button, calls CBCGPToolbarButton::CopyFrom and inserts the copy into the specified category.

When the new button is inserted, it receives the CBCGPToolbarButton::OnAddToCustomizePage notification.

If iInsertAfter is -1, the button is inserted at the end of the list of categories, otherwise it is inserted after an item with the specified index.

Parameters
lpszCategorySpecifies the category string to insert the button.
buttonSpecifies the button to insert.
iInsertAfterSpecifies the zero-based index of a toolbar button after which the button should be inserted.