다음을 통해 공유


Debugger.CurrentProcess 속성

활성 프로세스를 가져오거나 설정합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
Property CurrentProcess As Process
Process CurrentProcess { get; set; }
property Process^ CurrentProcess {
    Process^ get ();
    void set (Process^ value);
}
abstract CurrentProcess : Process with get, set
function get CurrentProcess () : Process 
function set CurrentProcess (value : Process)

속성 값

형식: EnvDTE.Process
Process 개체

설명

CurrentProcess는 활성 Process를 설정하거나 반환합니다. 활성 프로세스는 디버거를 통해 표시되는 데이터를 정의하는 프로세스입니다. 디버거는 동시에 여러 프로세스를 디버깅할 수 있지만 한 번에 한 프로세스만 활성이 될 수 있습니다. 자세한 내용은 <PAVEOVER> 여러 프로세스 디버깅를 참조하십시오.

예제

다음 예제에서는 CurrentProcess 속성을 사용하는 방법을 보여 줍니다.

이 속성을 테스트하려면

  1. 대상 응용 프로그램을 엽니다. 추가 기능을 실행합니다. 프로세스가 디버깅되지 않습니다.

  2. 대상 응용 프로그램에 중단점을 설정합니다. 디버그 모드에서 응용 프로그램을 실행합니다.

  3. 프로그램이 중단점에서 멈추면 추가 기능을 실행합니다. 프로세스가 디버깅됩니다.

public static void CurrentProcess(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("Current Process Test");
    owp.Activate();

    owp.OutputString("Current Process Info: ");
    EnvDTE.Process process = dte.Debugger.CurrentProcess;
    if(process == null)
        owp.OutputString("No process is being debugged");
    else
        owp.OutputString("Process ID = " + process.ProcessID + 
                         "  Process Name = " + process.Name);
}
Shared Sub CurrentProcess(ByRef dte As EnvDTE.DTE)
     Dim process As EnvDTE.Process = dte.Debugger.CurrentProcess
     If process Is Nothing Then
         MessageBox.Show("No process is being debugged", "Debugger Test")
     Else
         MessageBox.Show("Process ID = " + process.ProcessID.ToString() + _
                         "  Process Name = " + process.Name, "Debugger Test")
     End If
 End Sub

.NET Framework 보안

참고 항목

참조

Debugger 인터페이스

EnvDTE 네임스페이스