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


Type: System.IntPtr

Handle of the element's window.

Type: System.IntPtr

The wParam member of the WM_GETOBJECT message.

Type: System.IntPtr

The lParam member of the WM_GETOBJECT message.

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() == 
        m.Result = AutomationInteropProvider.ReturnRawElementProvider(
                this.Handle, m.WParam, m.LParam, 
    base.WndProc(ref m);

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