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

Create a class derived from CExtControlBar (or CExtToolControlBar, or CExtMenuControlBar) and override the OnNcAreaButtonsReinitialize() virtual method.

This is the source code of the CExtControlBar::OnNcAreaButtonsReinitialize() method:

void CExtControlBar::OnNcAreaButtonsReinitialize()
{
INT nCountOfNcButtons = NcButtons_GetCount();
      if( nCountOfNcButtons > 0 )
          return;
      NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
      NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
      NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}

If the X button is unwanted, just remove this line

NcButtons_Add( new CExtBarNcAreaButtonClose(this) );

However, your control bar can still be closed when it is tab docked inside a tabbed control bar container. Such tabbed control bar container is a newly/dynamically created resizable control bar which keeps both docked CExtControlBar windows and the CExtTabWnd tab control. This tabbed container is implemented as the CExtDynTabControlBar class. To hide the Close or X button, create a CExtDynTabControlBar-derived class and override the OnNcAreaButtonsReinitialize() virtual method as it is described above for CExtControlBar.

To use your tabbed control bar container in Prof-UIS, add a message handler for the CExtControlBar::g_nMsgCreateTabbedBar registered windows message:

// declaration in the header file
afx_msg LRESULT OnMsgCreateTabbedBar( 
   WPARAM wParam, 
   LPARAM lParam 
);
 
// message map entry
ON_REGISTERED_MESSAGE(
    CExtControlBar::g_nMsgCreateTabbedBar,
    OnMsgCreateTabbedBar
    )
 
// implementation
LRESULT CMainFrame::OnMsgCreateTabbedBar(
    WPARAM wParam, LPARAM lParam )
{
CExtDynTabControlBar ** ppTabbedBar =
      (CExtDynTabControlBar **)wParam;
    ASSERT( ppTabbedBar != NULL );
    (*ppTabbedBar) =
      new C_YOUR_DynTabControlBar;
    return 0;
}

Finally, when the control bar window is in the floating state, it is inside a miniframe window which is created and destroyed automatically by Prof-UIS. The X button on this frame just hides the window.

All the non-client area buttons are instances of the classes which are derived from CExtBarNcAreaButton. You can write your own buttons and initialize them in OnNcAreaButtonsReinitialize().