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

The constants specifying built-in pop-up menus are listed in the internal enumeration of the CExtControlBar::POPUP_MENU_EVENT_DATA structure in the ExtControlBar.h file:

enum // Prof-UIS notification types
{
__PMED_DOCKBAR_CTX       =  0, // dockbar context menu
__PMED_CONTROLBAR_CTX      =  1, // any control bar context menu (client area)
__PMED_CONTROLBAR_NC_CTX   =  2, // any control bar context menu (non-client area)
__PMED_STATUSBAR_CTX       =  3, // statusbar context menu
__PMED_AUTOHIDESLIDER_CTX    =  4, // autohide slider window context menu
__PMED_MINIFRAME_NC_CTX    =  5, // miniframe context menu (non-client area)
__PMED_MDICLIAREA_CTX      =  6, // MDI client area context menu
__PMED_MDITABS_CTX       =  7, // MDI-tabs window
__PMED_AUTOHIDETABS_CTX    =  8, // autohide-tabs window
__PMED_DYNCBCTABS_CTX      =  9, // dynamic control bar container tabs window
__PMED_CONTROLBAR_NCBTNMENU_TOP   = 10, // control bar nc-area-menu-button - top level
__PMED_CONTROLBAR_NCBTNMENU_BARS  = 11, // control bar nc-area-menu-button - control bars list 
__PMED_CTXEXPBTN_TOP      = 12, // content expand button - top level
__PMED_CTXEXPBTN_APPEND   = 13, // content expand button - append to buttons list
__PMED_CTXEXPBTN_BARS     = 14, // content expand button - control bars list
__PMED_CONTROLBAR_NCBTNMENU_DYNSTATE = 15, // dynamic resizable control bar nc-area-menu-button
__PMED_TAB_PAGE_CONTAINER_TABS_CTX   = 16, // page-container-as-main-view-tabs window
};

You can modify, completely recreate, or entirely suppress any built-in Prof-UIS pop-up menu. The CExtControlBar::g_nMsgConstructPopupMenu registered windows message is sent twice to the main frame window for each of built-in pop-up menus. When the message is sent for the first time, you can create a pop-up menu from scratch. When it is sent for the second time, you can modify the pop-up menu created by default. So, your handler method may look like:

// Message map
ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgConstructPopupMenu, OnConstructPopupMenuCB )
 
// Handler LRESULT CMainFrame::OnConstructPopupMenuCB( WPARAM wParam, LPARAM lParam )
{
   ASSERT_VALID( this );
   lParam;
CExtControlBar::POPUP_MENU_EVENT_DATA * p_pmed =
   CExtControlBar::POPUP_MENU_EVENT_DATA::FromWParam( wParam );
   ASSERT( p_pmed != NULL );
   ASSERT_VALID( p_pmed->m_pPopupMenuWnd );
   ASSERT_VALID( p_pmed->m_pWndEventSrc );
   ASSERT( p_pmed->m_pWndEventSrc->GetSafeHwnd() != NULL );
   ASSERT( ::IsWindow(p_pmed->m_pWndEventSrc->GetSafeHwnd()) );
   if( p_pmed->m_bPostNotification )
   {
    // p_pmed->m_pPopupMenuWnd contains default items
    // you can change this menu here
   }
   else
   {
    // initialize the p_pmed->m_pPopupMenuWnd menu
    // from scratch
    // otherwise return 0 to get this method called for the second time
   }
   return (!0);
}

The p_pmed->m_nHelperNotificationType variable specifies the type of the built-in pop-up menu to be initialized or modified (see the enumeration above).

For example, the ProfStudio sample handles the CExtControlBar::g_nMsgConstructPopupMenu registered Windows message in the CMainFrame::OnConstructPopupMenuCB() method.

As another example, you can suppress the menu to be appeared over the dock site by using the following code:

LRESULT LRESULT CMainFrame::OnConstructPopupMenuCB(
    WPARAM wParam, LPARAM lParam
    )
{
   ASSERT_VALID( this );
   lParam;
CExtControlBar::POPUP_MENU_EVENT_DATA * p_pmed =
   CExtControlBar::POPUP_MENU_EVENT_DATA::FromWParam( wParam );
   ASSERT( p_pmed != NULL );
   ASSERT_VALID( p_pmed->m_pPopupMenuWnd );
   ASSERT_VALID( p_pmed->m_pWndEventSrc );
   ASSERT( p_pmed->m_pWndEventSrc->GetSafeHwnd() != NULL );
   ASSERT( ::IsWindow(p_pmed->m_pWndEventSrc->GetSafeHwnd()) );
 
   if( ( !p_pmed->m_bPostNotification)
    && p_pmed->m_nHelperNotificationType ==
       CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_DOCKBAR_CTX
    )
    return (!0);
 
   return 0;
}

If you do not want this kind of menu at all, use the code like this:

LRESULT CMainFrame::OnConstructPopupMenuCB(
   WPARAM wParam, LPARAM lParam
   )
{
   ASSERT_VALID( this );
   lParam;
CExtControlBar::POPUP_MENU_EVENT_DATA * p_pmed =
    CExtControlBar::
       POPUP_MENU_EVENT_DATA::
        FromWParam( wParam );
   ASSERT( p_pmed != NULL );
   ASSERT_VALID( p_pmed->m_pPopupMenuWnd );
   ASSERT_VALID( p_pmed->m_pWndEventSrc );
   ASSERT( p_pmed->m_pWndEventSrc->GetSafeHwnd() != NULL );
   ASSERT( ::IsWindow(p_pmed->m_pWndEventSrc->GetSafeHwnd()) );
 
   return (!0); // Leaves any built-in menu empty (i.e. suppress any built-in menu)
 
}