0

I've been trying for several hours to extend the context menu of the Output window in Visual Studio, so that clicking on it with the left mouse button would display an item linked to my custom command.

To help with this, I installed Command Explorer by Mads Kristensen, which allowed me to find the proper GUID and ID for the context menu. For the Output window context menu, I’m using the following:

<GuidSymbol name="DocumentWindowCommandSet" value="{C9DD4A59-47FB-11D2-83E7-00C04F9902C1}">
  <IDSymbol name="DocumentContextMenu" value="0x155"/>
</GuidSymbol>

Guid and ID I take from: CommandExplorer

I also found and reviewed these related questions:

However, none of them helped resolve my issue.

Here is the current version of my .vsct file:

<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <Extern href="stdidcmd.h"/>
  <Extern href="vsshlids.h"/>

  <Commands package="guidOutputMenuExtensionPackage">

    <Groups>
      <Group guid="guidOutputMenuExtensionPackageCmdSet" id="MyMenuGroup" priority="0x0600">
        <Parent guid="DocumentWindowCommandSet" id="DocumentContextMenu"/>
      </Group>
    </Groups>

    <Buttons>
      <Button guid="guidOutputMenuExtensionPackageCmdSet" id="Command1Id" priority="0x0100" type="Button">
        <Parent guid="guidOutputMenuExtensionPackageCmdSet" id="MyMenuGroup" />
        <Icon guid="guidImages" id="bmpPic1" />
        <Strings>
          <ButtonText>EXECUTE Command1</ButtonText>
        </Strings>
      </Button>
    </Buttons>

    <Bitmaps>
      <Bitmap guid="guidImages" href="Resources\Command1.png" usedList="bmpPic1"/>
    </Bitmaps>

  </Commands>

  <Symbols>
    <GuidSymbol name="guidOutputMenuExtensionPackage" value="{9b255e13-1ab1-4a41-9bf8-194e2af5e5cb}" />

    <GuidSymbol name="DocumentWindowCommandSet" value="{C9DD4A59-47FB-11D2-83E7-00C04F9902C1}">
      <IDSymbol name="DocumentContextMenu" value="0x155"/>
    </GuidSymbol>

    <GuidSymbol name="guidOutputMenuExtensionPackageCmdSet" value="{30af3ca6-21df-4c44-adc4-fbe04533b289}">
      <IDSymbol name="MyMenuGroup" value="0x1020" />
      <IDSymbol name="Command1Id" value="0x0100" />
    </GuidSymbol>

    <GuidSymbol name="guidImages" value="{a132bff6-58d4-4a7f-835f-b910a930003f}" >
      <IDSymbol name="bmpPic1" value="1" />
    </GuidSymbol>
  </Symbols>
</CommandTable>

ChatGPT suggests using IDM_VS_CTXT_OUTPUTWINDOW, but such an identifier does not exist in vsshlids.h

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.