AutomationInteropProvider.ReturnRawElementProvider Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the UI automation provider for an element in response to a WM_GETOBJECT
message.
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
Parameters
- hwnd
-
IntPtr
nativeint
Handle of the element's window.
- wParam
-
IntPtr
nativeint
The wParam
member of the WM_GETOBJECT
message.
- lParam
-
IntPtr
nativeint
The lParam
member of the WM_GETOBJECT
message.
The UI Automation provider for the element.
Returns
IntPtr
nativeint
A pointer to data that should be assigned to Result before passing the message to the base window procedure.
Examples
/// <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
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET