CommandWindow Interface
Visual Studio 2015
Represents the Command window in the environment.
Assembly: EnvDTE (in EnvDTE.dll)
| Name | Description | |
|---|---|---|
![]() | DTE | Gets the top-level extensibility object. |
![]() | Parent | Gets the immediate parent object of a given object. |
![]() | TextDocument | Gets the TextDocument for the window or pane. |
| Name | Description | |
|---|---|---|
![]() | Clear() | Clears all text from the window. |
![]() | OutputString(String) | Sends a text string to the Command window. |
![]() | SendInput(String, Boolean) | Sends a line of input to the Command window that is processed as if you typed it. |
Reference this object by using DTE.Windows.Item(vsWindowKindCommand).Object.
void CommandWinExample(_DTE dte) { // Get a reference to the Command window. Window win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow); CommandWindow CW = (CommandWindow)win.Object; // Input a command into the Command window and execute it. CW.SendInput("nav http://www.microsoft.com", false); // Insert some information text into the Command window. CW.OutputString("This URL takes you to the main Microsoft website."); // Clear the contents of the Command window. MessageBox.Show("Clearing the Command window..."); CW.Clear(); }
Show:

