Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

Create a control with the dialog control identifier equal to the ID of an existing button on the toolbar. Then, assign the control to the button by calling the CExtToolControlBar::SetButtonCtrl() method.

If there is no command with such ID in the application menu (which means no text is set for this command when it appears in menus, e.g., in the menu activated from the toolbar chevron button), then it is recommended to set a menu text for this command:

if( !m_ComboHelpSearch.Create(
    WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,
    CRect( 0, 0, 200, 480 ),
    &m_wndToolBarMain,
    ID_HELP_SEARCH_COMBO
    )
   || !m_wndToolBarMain.SetButtonCtrl(
     m_wndToolBarMain.CommandToIndex(
      m_ComboHelpSearch.GetDlgCtrlID() ),
      &m_ComboHelpSearch
     )
)
{
    TRACE0("Failed to create help search combobox\n" );
    return -1;
}
 
m_ComboHelpSearch.SetItemHeight( -1, 16 );
 
m_ComboHelpSearch.SetFont( &g_PaintManager->m_FontNormal );
g_CmdManager->CmdGetPtr(
      m_ComboHelpSearch.GetDlgCtrlID()
     )-> m_sMenuText = _T( "Search help system" );