Udostępnij za pośrednictwem


Debugger2.DebuggedProcesses Property

Definition

Gets the list of processes currently being debugged.

public:
 property EnvDTE::Processes ^ DebuggedProcesses { EnvDTE::Processes ^ get(); };
[System.Runtime.InteropServices.DispId(112)]
public EnvDTE.Processes DebuggedProcesses { [System.Runtime.InteropServices.DispId(112)] get; }
[<System.Runtime.InteropServices.DispId(112)>]
[<get: System.Runtime.InteropServices.DispId(112)>]
member this.DebuggedProcesses : EnvDTE.Processes
Public ReadOnly Property DebuggedProcesses As Processes

Property Value

A Processes collection.

Implements

Attributes

Examples

The following example demonstrates how to use the DebuggedProcesses property.

public static void DebuggedProcesses(EnvDTE80.DTE2 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("Debugged Processes   
    Test");  
    owp.Activate();  

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;  
    EnvDTE.Processes processes = debugger.DebuggedProcesses;  
    if (processes.Count == 0)  
        owp.OutputString("No processes are being debugged.");  
    else  
        foreach (EnvDTE.Process proc in processes)  
            owp.OutputString("\nProcess: [" + proc.ProcessID + "] " +   
                             proc.Name);  
}  
Sub ListDebuggedProcesses()  
    Dim ow As OutputWindow  
    ow = DTE2.Windows.Item(Constants.vsWindowKindOutput).Object  
    Dim proc As EnvDTE.Process2  

    If DTE2.Debugger.DebuggedProcesses.Count = 0 Then  
        ow.ActivePane.OutputString("No processes are being debugged." _  
        & vbCrLf)  

    Else  
        For Each proc In DTE2.Debugger.DebuggedProcesses  
            ow.ActivePane.OutputString("Process: [" + _  
            Str(proc.ProcessID) + "] " + proc.Name + vbCrLf)  
        Next  
   End If  
End Sub  

Remarks

DebuggedProcesses gets a Processes collection representing the processes that are currently being debugged.

Applies to