We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

WindowConfiguration Interface

The WindowConfiguration object represents the layout and configuration of all windows in the Visual Studio environment.

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

public interface WindowConfiguration

The WindowConfiguration type exposes the following members.

Public propertyCollectionGets the collection containing the object supporting this property or contained within this code construct.
Public propertyDTEGets the top-level extensibility object.
Public propertyNameSets or gets the name of the object.

Public methodApplyInvokes a previously saved named window configuration.
Public methodDeleteRemoves the window configuration from the collection.
Public methodUpdateUpdates the collection as if the user opened the Add-in Manager dialog box, or sets the object's window layout to the current window layout.

You can save your current window layout in the Visual Studio environment as a named window configuration. The WindowConfiguration object represents this configuration, which you can later recall by using the Apply method.

void WinConfigExample1(_DTE dte)
// Set references to all necessary objects.
    WindowConfigurations colWinConfig; 
    WindowConfiguration objWinConfig;

    colWinConfig = dte.WindowConfigurations;

    MessageBox.Show("Number of configurations: " + 

    // List all saved named window configurations.
    //Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout");
    // Get rid of the new window configuration.
    MessageBox.Show("Number of configurations: " + colWinConfig.Count);

void FillMsg(WindowConfigurations colWinConfig )
      // Lists all currently available named window configurations.
    int lCtr;
    string strMsg = null;

    for (lCtr = 1; lCtr < colWinConfig.Count + 1; lCtr ++)
        strMsg = strMsg + "Configuration name " + lCtr + ": " + 
            colWinConfig.Item(lCtr).Name + "\n"; 
    strMsg = "Current Configurations: \n" + strMsg;