次の方法で共有


AutomationInteropProvider.ReturnRawElementProvider メソッド

定義

WM_GETOBJECT メッセージに対する応答として要素の UI 自動化プロバイダーを返します。

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

適用対象

こちらもご覧ください