BCGControlBar Pro for MFC
UINT BCGM_ON_BEFORE_SHOW_PALETTE_CONTEXTMENU

Sent to Ribbon's parent before a palette context menu is displayed.

Parameters
wParama handle to context menu
lParama pointer to CBCGPBaseRibbonElement that is clicked.
Returns
returns FALSE to display the context menu. Returns TRUE to prevent the context menu from being displayed.

The framework sends the BCGM_ON_BEFORE_SHOW_PALETTE_CONTEXTMENU message when the user clicks right mouse button on a palette item and a context menu is about to be displayed.

You can process this message and modify popup menus on the fly.