使用 vspackage 将上下文菜单项添加到解决方案资源管理器中的所有文件和文件夹 [英] Add context meu item to all files and folders in the solution explorer using vspackage
问题描述
我想在解决方案资源管理器中所有文件和文件夹的上下文菜单中添加一个菜单项.我能够使用 vsct 文件中的这个条目将我的菜单项添加到项目节点..
I want to add a menu item to the context menu of all the files and folders in the solution explorer. I was able to add my menu item to the project node with this entry in the vsct file..
<Menu guid="guidERAPackageAlphaCmdSet" id="ERAInsightMenu" priority="0x0700" type="Context">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD" />
<Strings>
<ButtonText>ERA Insight</ButtonText>
<CommandName>ERA Insight</CommandName>
</Strings>
</Menu>
我想在解决方案资源管理器中所有文件和文件夹的上下文菜单中获取此信息.我应该使用的 id 是什么?有什么地方可以找到 Visual Studio 中所有菜单的 ID?
I want to get this in the context menu of all files and folders in solution explorer. What is the id i should use? Is there any place where i can find the ids for all the menus in visual studio?
推荐答案
我知道这是旧的,但希望这对某人有所帮助.
I know this is old, but hopefully this helps someone.
如果您查看 vsct 文件的顶部,您应该看到:
If you look at the top of your vsct file, you should see this:
<!--This header contains the command ids for the menus provided by the shell. -->
<Extern href="vsshlids.h"/>
路径会因版本而异,但您应该能够在类似的路径中找到它:
The path will differ based on version, but you should be able to find it in a similar path to:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Common\Inc
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Common\Inc
此文件包含所有常量的列表,有些还包含说明.
This file contains a list of all of the constants and some have descriptions.
以下是文件中可用于原始问题的示例:
Here is an example of what could be used for the original question from the file:
// Common Item Node context menu
#define IDM_VS_CTXT_ITEMNODE 0x0430
// Folder Node context menu
#define IDM_VS_CTXT_FOLDERNODE 0x0431
这篇关于使用 vspackage 将上下文菜单项添加到解决方案资源管理器中的所有文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!