Creating VSCT files VSCT somewhat difficult; You will need a combination of menus and buttons. First of all, you need to specify the IDM_VS_CTXT_ITEMNODE group in your VSCT file.
<Group guid="guidCmdSet" id="grpIdMenuProjectItem" priority="0x0800"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE" /> </Group>
How do you create a new menu and add it to this group ...
<Menu guid="guidCmdSet" id="sampleMenu" type="Menu" priority="0x1000"> <Parent guid="guidCmdSet" id="grpIdMenuProjectItem" /> <CommandFlag>IconAndText</CommandFlag> <Strings> <ButtonText>Sample Menu</ButtonText> <CommandName>Sample Menu</CommandName> </Strings> </Menu>
For submenu items, another group is required, which will be added to the menu ...
<Group guid="guidCmdSet" id="sampleMenuGroup" priority="0x1000"> <Parent guid="guidCmdSet" id="sampleMenu"/> </Group>
At least you define the submenu items using the buttons and add them to the submenu group ...
<Button guid="guidCmdSet" id="sampleMenuItem" priority="0x1000" type="Button"> <Parent guid="guidCmdSet" id="sampleMenuGroup"/> <CommandFlag>TextOnly</CommandFlag> <Strings> <ButtonText>Sample Menu Item 1</ButtonText> <CommandName>sampleMenuItem1</CommandName> </Strings> </Button>
Remember to define all characters, otherwise the resource will not compile.
<IDSymbol name="grpIdMenuProjectItem" value="0x1020"/> <IDSymbol name="sampleMenu" value="0x1021"/> <IDSymbol name="sampleMenuGroup" value="0x1022"/> <IDSymbol name="sampleMenuItem" value="0x1023"/>
And here is what you get ...

Matze
source share