This documentation is archived and is not being maintained.

Process.Programs Property

Gets the collection of programs that are being managed by this process.

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

Programs Programs { get; }

Property Value

Type: EnvDTE.Programs
A Programs collection.

The following example demonstrates how to use the Programs property.

To test this property

  1. Set a breakpoint in your target application.

  2. Run the target application in the debug mode.

  3. When the application stops on the breakpoint, run the add-in.

public static void Programs(DTE dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Programs Property Test");
    owp.Activate();
    owp.OutputString("\nEdition of the environment: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).DTE.Edition);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Name);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Parent.CurrentProgram.Name);
    owp.OutputString("\nProcess ID: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).ProcessID);
    EnvDTE.Programs programs = 
                        dte.Debugger.DebuggedProcesses.Item(1).Programs;
    owp.OutputString("\nThe name of the current program: " + 
                        programs.Item(1).Name);
}

Show: