工具栏上下文菜单的GUID和ID [英] GUID and ID of the toolbar context menu

查看:65
本文介绍了工具栏上下文菜单的GUID和ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




目前我想在工具栏的上下文菜单中添加一个新菜单项。 "添加项目",类似于默认的"自定义..." 


为此,我需要找到上下文菜单的ID(加上GUID) ,如果可能的话。。 


vsct文件内容:

< CommandTable xmlns =" http:// schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable"的xmlns:XS = QUOT; HTTP://www.w3.org/2001/XMLSchema"> 

<! - 这是定义命令的实际布局和类型的文件。
它分为不同的部分(例如命令定义,命令
placement,...),每个部分定义一组特定的属性。
有关如何使用
的更多详细信息,请参阅每个部分之前的注释。 - >

<! - 这是定义VisualStudio公开的所有命令的ID的文件。 - >
< Extern href =" stdidcmd.h" />
等.....


< Group guid =" guidMyPackageCmdSet1" ID = QUOT; ToolbarContextMenuGroup"优先级= QUOT;为0x0600">
< Parent guid =" guidSHLMainMenu" ID = QUOT; ????????????????" />
< / Group>
< / CommandTable>

id应该是工具栏的上下文菜单。例如,代码编辑器的上下文菜单ID是IDM_VS_CTXT_CODEWIN。任何智慧的话都赞赏大家!




解决方案

你可以设置 EnableVSIPLogging 注册表值,然后按住Ctrl + Shift单击任何菜单,工具栏命令或上下文菜单项以获取所需命令的GUID和ID:

EnableVSIPLogging显示VS命令信息



Currently I want to add a new menu item to the toolbar's context menu. "Add item", which is similar to the default "Customize..." 

To do this, I need to find the ID of the context menu (plus GUID, if possible). 

The vsct file content:

<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <!--  This is the file that defines the actual layout and type of the commands.
        It is divided in different sections (e.g. command definition, command
        placement, ...), with each defining a specific set of properties.
        See the comment before each section for more details about how to
        use it. -->

  <!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
  <Extern href="stdidcmd.h" />
etc.....


<Group guid="guidMyPackageCmdSet1" id="ToolbarContextMenuGroup" priority="0x0600">
  <Parent guid="guidSHLMainMenu" id="????????????????" />
</Group>
</CommandTable>

The id should be the toolbar's context menu's. For example, the code editor's context menu id is IDM_VS_CTXT_CODEWIN. Any words of wisdom appreciated guys!


解决方案

You can set EnableVSIPLogging registry value and then hold Ctrl+Shift clicking any menu, toolbar command or context menu item to get GUID and ID of a command you need: EnableVSIPLogging to show VS command info


这篇关于工具栏上下文菜单的GUID和ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆