Click here to Skip to main content
15,886,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I created a visual studio extension Tool Window. I need to open a third party Tool Window (from a vendor) in my Tool Windo. This third party Tool Window is currently a menu item under View. Is there any other way to open the third party tool window or can you offer any suggestions? Is there any other way to simulate a click on the third party menu (which opens up the tool window) programatically?

What I have tried:

I did manage to find the GUID of the third party tool Window in registery but and  it opens up the Visual Studio output window for some reason. The other GUID's I found are for the menu item of the third party tool window. They dont work using below code.


<pre>   IVsUIShell vsUIShell = (IVsUIShell)Package.GetGlobalService(typeof(SVsUIShell));
                Guid guid = new Guid("{667E76E81-EE4A-22D0-AE2E-00A0450FFF55}");
              
                IVsWindowFrame windowFrame;
                Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
                                         new Action(() =>
                                         {
                                             int result = vsUIShell.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fFindFirst, ref guid, out windowFrame);   // Find MyToolWindow
                                             if (result != VSConstants.S_OK)
                                                 result = vsUIShell.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fForceCreate, ref guid, out windowFrame); // Crate MyToolWindow if not found
                                             if (result == VSConstants.S_OK)                                                                           // Show MyToolWindow
                                                 ErrorHandler.ThrowOnFailure(windowFrame.Show());
                                         }
                        ));
Posted
Updated 29-Jan-18 11:29am
v2

1 solution

I was able to open the third party tool by finding GUID of the tool window for Visual Studio. All Tool Window GUID's are at Computer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\ToolWindows\
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900