Sam
Sam

Reputation: 1707

VS2015 extension in context menu for html context files

I'm trying to add a context window to a HTML Context editor window in visual studio, I successfully retrieved the Code Window ID from the vshlids.h file, following guides on stackoverflow.

Guid={D309F791-903F-11D0-9EFC-00A0C911004F}
GuidID=4
CmdID=1037
Type=0x00000400
Flag=0x00000000
NameLoc=Code Window

#define IDM_VS_CTXT_CODEWIN           0x040D

But with the Html Context window I'm truly in the dark:

Guid={78F03954-2FB8-4087-8CE7-59D71710B3BB}
GuidID=353
CmdID=1
Type=0x00000400
Flag=0x00000000
NameLoc=Html Context

So I do know how to get the dialog showing window/menu data, I just can't find the ID for this particular one. Can anyone help me with getting the equivalent for the Html Context ID so I can add a menu item to it's context menu? Thanks!

Upvotes: 4

Views: 292

Answers (1)

sboulema
sboulema

Reputation: 836

Using the debug trick from this page: Using EnableVSIPLogging to identify menus and commands

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\General] “EnableVSIPLogging”=dword:00000001

I got the following info:

Guid = {78F03954-2FB8-4087-8CE7-59D71710B3BB}
GuidID = 329
CmdID = 1
Type = 0x00000400
Flags = 0x00000000
NameLoc = HTML Context

Translated that to my VSPackage .vsct file:

<GuidSymbol name="HTMLContext" value="{78F03954-2FB8-4087-8CE7-59D71710B3BB}">
  <IDSymbol name="menu" value="0x0001"/>
</GuidSymbol>

So the code for the context menu becomes:

<Group guid="guidCmdSet" id="contextMenuGroup" priority="0x0100">
  <Parent guid="HTMLContext" id="menu" />
</Group>

And then my context menu started showing up

I am using the Visual Studio "15" preview on Windows 10*

Upvotes: 2

Related Questions