다음을 통해 공유


AutomationInteropProvider.ReturnRawElementProvider 메서드

정의

WM_GETOBJECT 메시지에 따라 요소의 UI Automation 공급자를 반환합니다.

public:
 static IntPtr ReturnRawElementProvider(IntPtr hwnd, IntPtr wParam, IntPtr lParam, System::Windows::Automation::Provider::IRawElementProviderSimple ^ el);
public static IntPtr ReturnRawElementProvider (IntPtr hwnd, IntPtr wParam, IntPtr lParam, System.Windows.Automation.Provider.IRawElementProviderSimple el);
static member ReturnRawElementProvider : nativeint * nativeint * nativeint * System.Windows.Automation.Provider.IRawElementProviderSimple -> nativeint
Public Shared Function ReturnRawElementProvider (hwnd As IntPtr, wParam As IntPtr, lParam As IntPtr, el As IRawElementProviderSimple) As IntPtr

매개 변수

hwnd
IntPtr

nativeint

요소 창의 핸들입니다.

wParam
IntPtr

nativeint

WM_GETOBJECT 메시지의 wParam 멤버입니다.

lParam
IntPtr

nativeint

WM_GETOBJECT 메시지의 lParam 멤버입니다.

el
IRawElementProviderSimple

요소의 UI 자동화 공급자입니다.

반환

IntPtr

nativeint

기본 창 프로시저에 메시지를 전달하기 전에 Result 에 할당해야 하는 데이터에 대한 포인터입니다.

예제

/// <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);
}
''' <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 Overrides Sub WndProc(ByRef m As Message)
    Const WM_GETOBJECT As Integer = &H3D

    If m.Msg = WM_GETOBJECT AndAlso m.LParam.ToInt32() = AutomationInteropProvider.RootObjectId Then
        m.Result = AutomationInteropProvider.ReturnRawElementProvider(Me.Handle, m.WParam, m.LParam, DirectCast(Me, IRawElementProviderSimple))
        Return
    End If
    MyBase.WndProc(m)

End Sub

적용 대상

추가 정보