AutomationElement.NativeWindowHandleProperty Pole

Definicja

Identyfikuje NativeWindowHandle właściwość .

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

Wartość pola

Przykłady

Poniższy przykład pobiera bieżącą wartość właściwości. Wartość domyślna jest zwracana, jeśli element nie podaje go.

int nativeHandle = (int)
    autoElement.GetCurrentPropertyValue(AutomationElement.NativeWindowHandleProperty);
Dim nativeHandle As Integer = _
    CInt(autoElement.GetCurrentPropertyValue(AutomationElement.NativeWindowHandleProperty))

Poniższy przykład pobiera bieżącą wartość właściwości, ale określa, że jeśli sam element nie podaje wartości właściwości, NotSupported należy zwrócić zamiast wartości domyślnej.

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

Uwagi

Ten identyfikator jest używany przez aplikacje klienckie automatyzacja interfejsu użytkownika. automatyzacja interfejsu użytkownika dostawcy powinni użyć równoważnego identyfikatora w pliku AutomationElementIdentifiers.

Tę właściwość można również pobrać z Current właściwości lub Cached .

Zwracane wartości właściwości są typu Int32. Wartość domyślna właściwości to 0.

Dotyczy

Zobacz też