AutomationInteropProvider.HostProviderFromHandle Method (IntPtr)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a UI Automation provider that represents the specified window.

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

public static IRawElementProviderSimple HostProviderFromHandle(
	IntPtr hwnd
)

Parameters

hwnd
Type: System.IntPtr

The handle of the window.

Return Value

Type: System.Windows.Automation.Provider.IRawElementProviderSimple

The raw element provider for the specified window.

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.

/// <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);  
    }
}

.NET Framework
Available since 3.0
Return to top
Show: