1

I'm trying to create a Visual Studio extension but I'm struggling with a few points.

  • When creating a Menu Command, it goes by default to the Tools menu ( id="IDM_VS_MENU_TOOLS"). I want to change it to the Test menu, but I can't find the id for it anywhere.

  • How can I add a call to the Options window? Basically I want to have a Tools > My Menus > Options that goes straight to my items in the Options windows.

Any help?

Thanks!

Icaroto
  • 142
  • 10

1 Answers1

1

To determine a menu item id, you can use the EnableVSIPLogging registry key described here: Using EnableVSIPLogging to identify menus and commands with VS 2005 + SP1.

Note if you use Visual Studio 2017, you will have to do it in VS' private registry, using the procedure described here: Access Visual Studio 2017's private registry hive, and the EnableVSIPLogging value would be located in a key that will look like this (5e87da33 will be something different, specific to your setup):

<your private key name>\Software\Microsoft\VisualStudio\15.0_5e87da33\General

Once this is done you can CTRL+SHIFT click on "Test" and it will show you this:

enter image description here

Don't forget to do the reverse.

To show your own option page, create a menu item (using vsct, etc.), and call Package.ShowOptionPage when clicked.

L Y E S - C H I O U K H
  • 4,765
  • 8
  • 40
  • 57
Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
  • That worked perfectly! May I bother you with another one? The options page: is there a recommended way to store/save the settings? I was planning to store it in a json file, so I could load/read from it every time the options page is opened. But maybe theres an easy/proper way of doing it. Thanks – Icaroto Mar 18 '18 at 22:19
  • @Icaroto - VS provides classes for storing user settings: https://learn.microsoft.com/en-us/visualstudio/extensibility/writing-to-the-user-settings-store – Simon Mourier Mar 19 '18 at 07:38
  • Hi @Simon, Thanks for the link. So basically this is the recommended way from MS? I mean, I have quite a lot of settings to save so I was concerned that this method wasn't a good idea. – Icaroto Mar 19 '18 at 14:29