다음을 통해 공유


Debugger.CurrentProcess 속성

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

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

구문

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

예제

다음 예제에서는 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 네임스페이스