Process2 介面

Process2 物件是用以檢視和管理處理序。 Process2 物件是用以取代 Process 物件。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
<GuidAttribute("95AC1923-6EAA-427C-B43E-6274A8CA6C95")> _
Public Interface Process2 _
    Inherits Process
[GuidAttribute("95AC1923-6EAA-427C-B43E-6274A8CA6C95")]
public interface Process2 : Process
[GuidAttribute(L"95AC1923-6EAA-427C-B43E-6274A8CA6C95")]
public interface class Process2 : Process
[<GuidAttribute("95AC1923-6EAA-427C-B43E-6274A8CA6C95")>]
type Process2 =  
    interface
        interface Process
    end
public interface Process2 extends Process

Process2 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Collection (繼承自 Process)。
公用屬性 Collection 取得集合,內含支援這個屬性的物件或這個程式碼建構中的物件。
公用屬性 DTE (繼承自 Process)。
公用屬性 DTE 取得最上層的擴充性物件。
公用屬性 IsBeingDebugged 取得值,指出程式是否正在偵錯。
公用屬性 Name (繼承自 Process)。
公用屬性 Name 取得處理序的名稱。
公用屬性 Parent (繼承自 Process)。
公用屬性 Parent 取得 Process2 物件的直屬父物件。
公用屬性 ProcessID (繼承自 Process)。
公用屬性 ProcessID 取得指派給這個處理序的 ID 編號。
公用屬性 Programs (繼承自 Process)。
公用屬性 Programs 取得 Program 物件的集合。
公用屬性 Threads 取得 Thread 物件的集合。
公用屬性 Transport 取得用以偵錯此處理序的 Transport
公用屬性 TransportQualifier 電腦名稱或 IP 位址。
公用屬性 UserName

回頁首

方法

  名稱 說明
公用方法 Attach() (繼承自 Process)。
公用方法 Attach() 讓偵錯工具附加此處理序。
公用方法 Attach2 Attach 類似,會造成偵錯工具附加到此處理序,它只允許您指定一個或一組引擎。
公用方法 Break(Boolean) (繼承自 Process)。
公用方法 Break(Boolean) 使指定的處理序暫停執行,如此才能分析其目前的狀態。
公用方法 Detach(Boolean) (繼承自 Process)。
公用方法 Detach(Boolean) 讓偵錯工具中斷與處理序的連結。
公用方法 Terminate(Boolean) (繼承自 Process)。
公用方法 Terminate(Boolean) 結束此處理序。

回頁首

範例

' Macro code.
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Imports Microsoft.VisualBasic.ControlChars

Public Module Module1

    Sub NativeAttachToLocalCalc()
        Dim dbg2 As EnvDTE80.Debugger2
        dbg2 = DTE.Debugger

        Dim attached As Boolean = False
        Dim proc As EnvDTE80.Process2
        For Each proc In DTE.Debugger.LocalProcesses
            If (Right(proc.Name, 8) = "calc.exe") Then
                proc.Attach2("native")
                attached = True
                Exit For
            End If
        Next

        If attached = False Then
            If attached = False Then
                MsgBox("calc.exe isn't running")
            End If
        End If
    End Sub
End Module

請參閱

參考

EnvDTE80 命名空間

Process

其他資源

Automation 物件模型圖表