MCPcopy Create free account
hub / github.com/clechasseur/pathcopycopy / AddPluginToMenu

Method AddPluginToMenu

PathCopyCopy/src/PathCopyCopyContextMenuExt.cpp:750–770  ·  view source on GitHub ↗

Adds a new item to the given menu (either the main contextual menu or our submenu can be used) and assigns the given plugin to it. This will be called multiple times by the QueryContextMenu method to fill in the menu with all the items. @param p_PluginId ID of plugin to add to the menu. @param p_hMenu Handle of menu to add the item to. @param p_UsePCCIcon Whether to use the PCC icon for this plug

Source from the content-addressed store, hash-verified

748// @return Error code, or S_OK if the item was added to the menu.
749//
750HRESULT CPathCopyCopyContextMenuExt::AddPluginToMenu(const GUID& p_PluginId,
751 HMENU const p_hMenu,
752 const bool p_UsePCCIcon,
753 const bool p_UsePreviewMode,
754 const bool p_DropRedundantWords,
755 const bool p_ComputeShortcut,
756 UINT& p_rCmdId,
757 UINT& p_rPosition)
758{
759 // Look for the plugin in the set of all plugins.
760 const auto pluginIt = m_sspAllPlugins.find(p_PluginId);
761
762 // If we have a plugin, continue.
763 HRESULT hRes = E_INVALIDARG;
764 if (pluginIt != m_sspAllPlugins.end()) {
765 hRes = AddPluginToMenu(*pluginIt, p_hMenu, p_UsePCCIcon, p_UsePreviewMode,
766 p_DropRedundantWords, p_ComputeShortcut, p_rCmdId, p_rPosition);
767 }
768
769 return hRes;
770}
771
772//
773// Adds a new item to the given menu (either the main contextual menu or

Callers

nothing calls this directly

Calls 12

emptyMethod · 0.80
endMethod · 0.45
ShowForFilesMethod · 0.45
ShowForFoldersMethod · 0.45
EnabledMethod · 0.45
GetPathMethod · 0.45
sizeMethod · 0.45
DescriptionMethod · 0.45
CanDropRedundantWordsMethod · 0.45
UseDefaultIconMethod · 0.45
IconFileMethod · 0.45
GetIconFileForPluginMethod · 0.45

Tested by

no test coverage detected