ReturnRawElementProvider Method
Collapse the table of content
Expand the table of content

AutomationInteropProvider.ReturnRawElementProvider Method (IntPtr, IntPtr, IntPtr, IRawElementProviderSimple)

 

Returns the UI automation provider for an element in response to a WM_GETOBJECT message.

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

public static IntPtr ReturnRawElementProvider(
	IntPtr hwnd,
	IntPtr wParam,
	IntPtr lParam,
	IRawElementProviderSimple el
)

Parameters

hwnd
Type: System.IntPtr

Handle of the element's window.

wParam
Type: System.IntPtr

The wParam member of the WM_GETOBJECT message.

lParam
Type: System.IntPtr

The lParam member of the WM_GETOBJECT message.

el
Type: System.Windows.Automation.Provider.IRawElementProviderSimple

The UI Automation provider for the element.

Return Value

Type: System.IntPtr

A pointer to data that should be assigned to Result before passing the message to the base window procedure.

/// <summary>
/// Handles WM_GETOBJECT message; others are passed to base handler.
/// </summary>
/// <param name="m">Windows message.</param>
/// <remarks>
/// This method enables UI Automation to find the control.
/// In this example, the implementation of IRawElementProvider is in the same class
/// as this method.
/// </remarks>
protected override void WndProc(ref Message m)
{
    const int WM_GETOBJECT = 0x003D;

    if ((m.Msg == WM_GETOBJECT) && (m.LParam.ToInt32() == 
        AutomationInteropProvider.RootObjectId))
    {
        m.Result = AutomationInteropProvider.ReturnRawElementProvider(
                this.Handle, m.WParam, m.LParam, 
                (IRawElementProviderSimple)this);
        return;
    }
    base.WndProc(ref m);
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft