次の方法で共有


Debugger2.DebuggedProcesses プロパティ

現在デバッグ中のプロセスのリストを取得します。

名前空間:  EnvDTE80
アセンブリ:  EnvDTE80 (EnvDTE80.dll 内)

構文

'宣言
ReadOnly Property DebuggedProcesses As Processes
Processes DebuggedProcesses { get; }
property Processes^ DebuggedProcesses {
    Processes^ get ();
}
abstract DebuggedProcesses : Processes
function get DebuggedProcesses () : Processes

プロパティ値

型 : EnvDTE.Processes
Processes コレクション。

解説

DebuggedProcesses は、現在デバッグ中のプロセスを表す Processes コレクションを取得します。

DebuggedProcesses プロパティを使用する方法を次の例に示します。

このプロパティをテストするには

  1. ターゲット アプリケーションにブレークポイントを設定します。アドインを実行します。

    デバッグ中のプロセスはありません。

  2. ターゲット アプリケーションにブレークポイントを設定します。ターゲットを実行します。ブレークポイントでアプリケーションが停止したら、アドインを実行します。

    プロセスはデバッグされています。

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

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

Debugger2 インターフェイス

DebuggedProcesses オーバーロード

EnvDTE80 名前空間