다음을 통해 공유


Debugger3.CurrentProcess 속성

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

네임스페이스:  EnvDTE90
어셈블리:  EnvDTE90(EnvDTE90.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 개체입니다.

구현

Debugger2.CurrentProcess

설명

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

예제

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

이 속성을 테스트하려면

  1. 대상 응용 프로그램을 엽니다. 추가 기능을 실행합니다.

    프로세스가 디버깅되지 않습니다.

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

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

    프로세스가 디버깅됩니다.

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

    owp.OutputString("Current Process Info: ");
    EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
    EnvDTE90.Process2 process = (EnvDTE90.Process2)debugger.CurrentProcess;

    if (process == null)
        owp.OutputString("No process is being debugged");
    else
        owp.OutputString("Process ID = " + process.ProcessID +
                         "  Process Name = " + process.Name);
}
Sub ShowCurrentProcess()
    ' This function displays the current debugger
    ' mode in the output window.
    Dim ow As OutputWindow
    ow = dte.Windows.Item(Constants.vsWindowKindOutput).Object

    Dim proc As EnvDTE90.Process3
    proc = dte.Debugger.CurrentProcess

    If (proc Is Nothing) Then
        ow.ActivePane.OutputString("No process is being debugged")
    Else
        ow.ActivePane.OutputString("" + Str(proc.ProcessID) + ": " + _
        poc.Name + vbCrLf)
    End If
End Sub

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Debugger3 인터페이스

CurrentProcess 오버로드

EnvDTE90 네임스페이스