Share via


AutomationElement.NativeWindowHandleProperty Campo

Definizione

Identifica la proprietà NativeWindowHandle.

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 

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà . Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

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

Nell'esempio seguente viene recuperato il valore corrente della proprietà , ma viene specificato che se l'elemento stesso non fornisce un valore per la proprietà , NotSupported deve essere restituito anziché un valore predefinito.

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

Commenti

Questo identificatore viene usato da Automazione interfaccia utente applicazioni client. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

I valori restituiti della proprietà sono di tipo Int32. Il valore predefinito per la proprietà è 0.

Si applica a

Vedi anche