ToolWindows.GetToolWindow(String) ToolWindows.GetToolWindow(String) ToolWindows.GetToolWindow(String) ToolWindows.GetToolWindow(String) ToolWindows.GetToolWindow(String) ToolWindows.GetToolWindow(String) Method

Definition

Allows the user to retrieve a window by its title.

public:
 System::Object ^ GetToolWindow(System::String ^ Name);
public:
 Platform::Object ^ GetToolWindow(Platform::String ^ Name);
winrt::Windows::Foundation::IInspectable GetToolWindow(std::wstring const & Name);
[System.Runtime.InteropServices.DispId(0)]
public object GetToolWindow (string Name);
abstract member GetToolWindow : string -> obj
Public Function GetToolWindow (Name As String) As Object
Parameters
Name
String String String String String String

The title of the window to retrieve.

Returns

Examples

This example obtains the caption of the Output Window, after retrieving it using the GetToolWindow method.

Imports EnvDTE  
Imports EnvDTE80  
Sub GetToolWindow(ByVal dte As DTE2)  
    Dim win As OutputWindow  
    win = _applicationObject.ToolWindows.OutputWindow  
    Dim aStr As String = win.Parent.Caption  
    win = CType(_applicationObject.ToolWindows.GetToolWindow(aStr), _  
 OutputWindow)  
    MsgBox("The window caption, obtained via GetToolWindow method, _  
 is: " & vbCr & win.Parent.Caption)  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void GetToolWindow (DTE2 dte)  
{  
    Output win;  
    win = _applicationObject.ToolWindows.OutputWindow;  
    String aStr = win.Parent.Caption;  
    win =   
(OutputWindow)_applicationObject.ToolWindows.GetToolWindow(aStr);  
MessageBox.Show(("The window caption, obtained via GetToolWindow  
 method, is: " + "
" + win.Parent.Caption); }

Applies to