Choosing where my menu item appears for a VSPackage extension - visual-studio-2013

I am trying to create a visual studio extension menu item and I am having a tough time finding out how to choose which context menu the extension shows up in. Example; I right click on a TFS ticket and I see my added menu item in the context menu and not in the Tools menu. What in a VSPackage project tells Visual Studio where to place my extension?

In your package vsct file the CommandPlacements node handles where to put command items. Generally you are looking at CommandPlacements->CommandPlacement->Parent->id=[Some visual studio constant guid for the menu you want.]
Example, this places my command in the right click context menu of a code editor window, the guid is defined in the constant IDM_VS_CTXT_CODEWIN.
<CommandPlacement guid="guidSquishEditorCmdSet" id="SquishEditorToolbarGroup" priority="0x600">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN" />
</CommandPlacement>

Related

Visual Studio --> Copy a selected control name to clipboard

It is a pain to pick a button name from the "Properties" grid window or even from "Document Outline" window
I want something like :
Right click a button or any other control in a form then from the context menu choose --> "Copy Name"
or a Shortcut key to copy the control name to clipboard
can I have a macro to do that inside visual studio 2010
or is there extension to do that ??
any idea ??
Edit:
CompCopy extension but for Visual Studio 2017 not Visual Studio 2010
As you can see from the shortcut list, there's no such a thing; but you can do it almost as easily as you said:
From the properties window, click the "AZ" button to sort your properties alphabetically; (Name), i.e. the name of the control, will be the third from the top and will stay that way
Click the control you want to copy the name of, e.g. a button
Press F4 to select the property window, where the name will be there for you to copy

Two extensions and one menu item

I want to use two VS extensions. Each extension creates its own menu item in VS2012 main menu. I would like to merge these menu items to one menu item. Is it possible to change vsix files to obtain this behavior or I should change the source code?
You can modify Visual Studio menu using Tools - Customize - Commands tab:

Visual Studio 2010: Name of document tab context menu

Does anyone know the name of the context menu that you get when right clicking a document tab in Visual Studio 2010?
I want to add the "Close All Documents" command to it, but I cannot figure out which context menu it is in the customize dialog.
You can find that menu at Other Context Menus | Easy MDI Document Window.

Adding context menu for VS 2010 Add-In on loading

I'm creating an Add-In for Visual Studio 2010.
I want to add the context menu item to the tab during Add-In loading
(in OnConnect method of the Add-In):
I do know how to add the menus using CommandBars.
I already added commands into "Tools" and "Solution Explorer" menus.
I just cannot find the CommandBar responsible for the menu, I need.
Can anybody help me?
Solution found.
You can enable logging of chosen menus.
Details:
http://blogs.msdn.com/b/dr._ex/archive/2007/04/17/using-enablevsiplogging-to-identify-menus-and-commands-with-vs-2005-sp1.aspx
http://blogs.msdn.com/b/dr._ex/archive/2007/04/17/using-ivsproffercommands-to-retrieve-a-visual-studio-commandbar.aspx

Add context menu to VS 2010 solution explorer (display item on solution only)

It is fairly easy to add a context menu item to the solution explorer in VS 2010. But how to display the menu item ONLY on solution items? Not on project items or something else?
Best regards,
D.R.
Use
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_SOLNNODE"/>
and reset the experimental instance before restarting VSX (you can find the reset script in the VS start menu folder)

Resources