Export (0) Print
Expand All

CommandWindow Interface

Represents the Command window in the environment.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

'Declaration
<GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA")> _
Public Interface CommandWindow

The CommandWindow type exposes the following members.

  NameDescription
Public propertyDTEGets the top-level extensibility object.
Public propertyParentGets the immediate parent object of a given object.
Public propertyTextDocumentGets the TextDocument for the window or pane.
Top

  NameDescription
Public methodClearClears all text from the window.
Public methodOutputStringSends a text string to the Command window.
Public methodSendInputSends a line of input to the Command window that is processed as if you typed it.
Top

Reference this object by using DTE.Windows.Item(vsWindowKindCommand).Object.

Sub CommandWinExample(ByVal dte As DTE)
    ' Get a reference to the Command window.
    Dim win As Window = _
    DTE.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow)
    Dim CW As 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.
    MsgBox("Clearing the Command window...")
    CW.Clear()
End Sub
Show:
© 2014 Microsoft