AutomationElement.ProcessIdProperty フィールド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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 です。