BCGControlBar Pro for MFC
UINT BCGM_ON_BEFORE_SHOW_RIBBON_ITEM_MENU

Sent to Ribbon's parent before popup menu has been displayed.

Parameters
wParamthis parameter is not used.
lParama pointer to CBCGPBaseRibbonElement.
Returns
the return value is ignored.

The framework sends BCGM_ON_BEFORE_SHOW_RIBBON_ITEM_MENU registered message to the Ribbon's parent before popup menu has been displayed.

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