Find the ID and GUID of any menu item in Visual Studio

When writing an extension to Visual Studio (or in my case to Team Explorer), you need to know the ID and GUID for context menus, tree's, etc. There is a setting in Visual Studio, which you can activate to get access to a debug window which contains exactly what you'll need. Most of it is explained in this blog post.

But you will need to make a few changes to make it work in later versions of Visual Studio.

For Visual Studio 2008:


Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\General]
"EnableVSIPLogging"=dword:00000001

For Visual Studio 2010:


Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\General]
"EnableVSIPLogging"=dword:00000001



And for those who don't know it, if you type with any dialog box open, the contents will be copied to the clipboard as text, so instead of having to type these awful GUIDs, you can just get them from the clipboard (hint, paste into Notepad):

Will give you something like this on the clipboard:


---------------------------
VSDebug Message
---------------------------
Command data:
    Guid = {15061D55-E726-4E3C-97D3-1B871D9B5AE9}
    GuidID = 341
    CmdID = 8209
    Type = 0x00000001
    Flags = 0x00000070
    Canonical name = Team.NewQuery
    Localized name = (Not set)
---------------------------
OK
---------------------------