Condividi tramite


Debugger.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.

Attributes

Examples

The following example demonstrates how to use the DebuggedProcesses property.

public static void DebuggedProcesses(DTE dte)  
{  
    // Setup the 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();  

    EnvDTE.Processes processes = dte.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);  
}  
Shared Sub DebuggedProcesses(ByRef dte As EnvDTE.DTE)  
    Dim str As String  
    Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses  
    If processes.Count = 0 Then  
        MessageBox.Show("No processes are being debugged.", _  
                        "Debugger Test - Debugged Processes Test")  
    Else  
        For Each proc As EnvDTE.Process In processes  
            str += vbCrLf + "Process: [" + proc.ProcessID.ToString() + "] " + _  
                   proc.Name.ToString()  
        Next  
        MessageBox.Show(str, "Debugger Test - Debugged Processes Test")  
    End If  
End Sub  

Remarks

DebuggedProcesses returns a Processes collection representing those processes currently being debugged.

Applies to