AutomationInteropProvider.HostProviderFromHandle(IntPtr) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a UI Automation provider that represents the specified window.
public:
static System::Windows::Automation::Provider::IRawElementProviderSimple ^ HostProviderFromHandle(IntPtr hwnd);
public static System.Windows.Automation.Provider.IRawElementProviderSimple HostProviderFromHandle (IntPtr hwnd);
static member HostProviderFromHandle : nativeint -> System.Windows.Automation.Provider.IRawElementProviderSimple
Public Shared Function HostProviderFromHandle (hwnd As IntPtr) As IRawElementProviderSimple
Parameters
- hwnd
-
IntPtr
nativeint
The handle of the window.
Returns
The raw element provider for the specified window.
Examples
/// <summary>
/// Gets the host provider.
/// </summary>
/// <remarks>
/// Fragment roots return their window providers; most others return null.
/// </remarks>
IRawElementProviderSimple IRawElementProviderSimple.HostRawElementProvider
{
get
{
return AutomationInteropProvider.HostProviderFromHandle(myHandle);
}
}
''' <summary>
''' Gets the host provider.
''' </summary>
''' <remarks>
''' Fragment roots return their window providers; most others return null.
''' </remarks>
ReadOnly Property HostRawElementProvider() As IRawElementProviderSimple _
Implements IRawElementProviderSimple.HostRawElementProvider
Get
Return AutomationInteropProvider.HostProviderFromHandle(myHandle)
End Get
End Property
Remarks
The interface returned by this method can only be passed back to UI Automation. Attempting to call a method on the interface will raise an exception.
Applies to
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.