Thursday, June 14, 2012 1:38 PM
I want to add a menu item to the "Organize Usings" menu group that appears when you right-click in a .cs file, or go to Edit -> Intellisense in a .cs file. To do this, I need the GUID/ID of that menu group to place in the Parent tag of the button. For example:
<Button guid="myCmdSet" id="myButton" priority="0x0100" type="Button"> <Parent guid="guidSHLMainMenu (I think?)" id="???" /> <Icon guid="guidImages" id="bmpPic1" /> <Strings> <CommandName>myCommand</CommandName> <ButtonText>Do Stuff</ButtonText> </Strings> </Button>
I managed to find the GUID/ID of the "Organize Usings" menu via this method; however, this is not quite what I am looking for. I want the menu group GUID/ID, not the menu GUID/ID.
Side question: why isn't this information documented anywhere? MSDN only provides the GUID/IDs of the most visible menus and menu groups.
Monday, June 18, 2012 1:33 AMModerator
Thank you for your question.
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thank you for your understanding and support.
Monday, June 18, 2012 12:35 PMThanks for the update!
Monday, June 18, 2012 6:01 PMModerator
That particular menu is specific to CSharp, so it's definition is not published in the VS SDK. There are literally 10's of thousands of menus/groups/commands that can be integrated into the shell. While the VS SDK folks include the SharedCmdDef.vsct and similar, in the VSSDKs, ....\Common\Inc directory, and do have some wrapper classes for some of the common guids and shared command IDs, they can't hit them all. The VSCT PowerToy was created in part, to help integrators examine the menu structure of the IDE and is the only utility I know of that can readily ferret out group info. If you use the "View.Guids" menu item in the VSCT PowerToy, it'll toggle between the name and the actual ID values. For example: the ID value will toggle between "IDG_CSHARP_ORGANIZE" and "0x3617", which will give you the hint needed to parent your command in the right menu group.
Generally speaking, most extenders will place their custom commands in their own group, but if yours is specific to C#, you can certainly use one of their groups (provided it's parented on the menu(s)) you're interested in.
Tuesday, June 19, 2012 5:29 PM
Thanks very much for your time and your answer!
Thanks for linking that tool, too. Using it, I was able to add a button to the desired menu group. I suspect it will be very helpful in the future as well.
- Edited by Steven Hyland Tuesday, June 19, 2012 5:34 PM