WindowConfiguration Interface
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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
/** @attribute GuidAttribute("41D02413-8A67-4C28-A980-AD7539ED415D") */ 
public interface WindowConfiguration
public interface WindowConfiguration

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;
© 2015 Microsoft