AutomationElement.NativeWindowHandleProperty Campo

Definición

Identifica la propiedad 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 

Valor de campo

Ejemplos

En el ejemplo siguiente se recupera el valor actual de la propiedad . El valor predeterminado se devuelve si el elemento no proporciona uno.

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

En el ejemplo siguiente se recupera el valor actual de la propiedad , pero se especifica que si el propio elemento no proporciona un valor para la propiedad , NotSupported se devolverá en lugar de un valor predeterminado.

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

Comentarios

Las aplicaciones cliente de Automatización de la interfaz de usuario usan este identificador. Los proveedores de automatización de la interfaz de usuario deben usar el identificador equivalente en AutomationElementIdentifiers.

Esta propiedad también se puede recuperar de las Current propiedades o Cached .

Los valores devueltos de la propiedad son de tipo Int32. El valor predeterminado de la propiedad es 0.

Se aplica a

Consulte también