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
| 748 | // @return Error code, or S_OK if the item was added to the menu. |
| 749 | // |
| 750 | HRESULT 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 |
nothing calls this directly
no test coverage detected