AutomationElement.ProcessIdProperty 필드

정의

속성을 식별합니다 ProcessId .

public: static initonly System::Windows::Automation::AutomationProperty ^ ProcessIdProperty;
public static readonly System.Windows.Automation.AutomationProperty ProcessIdProperty;
 staticval mutable ProcessIdProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ProcessIdProperty As AutomationProperty 

필드 값

예제

다음 예제에서는 속성의 현재 값을 검색합니다. 요소가 제공하지 않으면 기본값이 반환됩니다.

int processIdentifier = (int)
    autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty);
Dim processIdentifier As Integer = _
    CInt(autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty))

다음 예제에서는 속성의 현재 값을 검색하지만 요소 자체가 속성 NotSupported 에 대한 값을 제공하지 않는 경우 기본값 대신 반환되도록 지정합니다.

int processIdentifier1;
object processIdentifierNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty, true);
if (processIdentifierNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    processIdentifier1 = (int)processIdentifierNoDefault;
}
Dim processIdentifier1 As Integer
Dim processIdentifierNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty, True)
If processIdentifierNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    processIdentifier1 = CInt(processIdentifierNoDefault)
End If

설명

이 식별자는 UI 자동화 클라이언트 애플리케이션에서 사용됩니다. UI 자동화 공급자는 AutomationElementIdentifiers 해당 식별자를 사용해야 합니다.

이 속성은 또는 Current 속성에서 Cached 검색할 수도 있습니다.

속성의 반환 값은 형식 Int32입니다. 속성의 기본값은 0입니다.

적용 대상

추가 정보