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

The Prof-UIS toolbar stores only command identifiers of its buttons. When it needs an icon, it gets it from the command manager. So, you need to use the CmdSetIcon() method of the command manager. The code below assigns a new icon (specified by the nIconID variable which is an icon resource identifier) to the command with nCmd identifier:

void CMainFrame::SetMyIcon( UINT nCmd, UINT nIconID ) 
{
    HICON hNewIcon = NULL;
    HINSTANCE hInstResource =
      AfxFindResourceHandle(
        MAKEINTRESOURCE( nIconID ),
        RT_GROUP_ICON
      );
    ASSERT( hInstResource != NULL );
    if( hInstResource != NULL ) {
      hNewIcon =
        (HICON)::LoadImage(
          hInstResource,
          MAKEINTRESOURCE( nIconID ),
          IMAGE_ICON,
          16, // icon's width in pixels 
          16, // icon's height in pixels
          0
        );
      ASSERT( hNewIcon != NULL );
    }
    if( hNewIcon != NULL ){
      g_CmdManager->CmdSetIcon( 
        g_CmdManager->ProfileNameFromWnd( GetSafeHwnd() ), 
        nCmd,  
        hNewIcon, 
        true // false - use hIcon "as is", 
           // true - use cloned hIcon
      );
      
      // If a new icon is of the same size as
      // the previous one, you should invalidate 
      // youroolbar, otherwise, you need to recalculate
      // the layout of toolbar's parent frame:
      
      if(m_wndToolBar .IsVisible() ){
        m_wndToolBar.GetParentFrame()->RecalcLayout();
        m_wndToolBar.Invalidate();
        m_wndToolBar.UpdateWindow();
      }
    }
}

NOTE: This code associates a new icon with a specified command identifier and the new icon will be assigned to all the toolbar/menu items with the same identifier.