Export (0) Print
Expand All

CommandWindow Interface

Represents the Command window in the environment.

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

[GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA")] 
public interface CommandWindow
/** @attribute GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA") */ 
public interface CommandWindow
GuidAttribute("509B9955-7303-48C9-90D4-E165B974E6BA") 
public interface CommandWindow

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);
    CommandWindowCW = (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();
}

Community Additions

ADD
Show:
© 2014 Microsoft