Is there a way to add/remove items from the existing context menus. For example, is it possible to add an "Add Stamp" menu just below the "Add Sticky Note" menu item?
Thanks,
Scott
Context Menu Customization
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Context Menu Customization
Hello tembreull,
You will need to listen to the e.beforeShowContextMenu event and then do something like in this sample:
And then you can insert or remove needed items.
Cheers,
Alex
You will need to listen to the e.beforeShowContextMenu event and then do something like in this sample:
Code: Select all
CComPtr<PXV::IPXV_Inst> pInst;
....
LONG nNecessaryMenuID;
pInst->Str2ID(CComBSTR(L"menu.tool.selectText"), &nNecessaryMenuID);
....
CComPtr<PXV::IPXV_BeforeShowContextMenuEvent> pMenuEvt;
pEvent->QueryInterface(&pMenuEvt);
if (pMenuEvt == nullptr)
return;
LONG nMenuID = 0;
pMenuEvt->get_MenuID(&nMenuID);
if (nMenuID != nNecessaryMenuID)
return;
CComPtr<PXV::IUIX_CmdMenu> pMenu;
pMenuEvt->get_Menu(&pMenu);
if (pMenu == nullptr)
return;
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ