AutomationPeer.GetHostRawElementProviderCore 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
告知 UI 自动化在 UI 自动化树 hwnd 中放置由 Windows Presentation Foundation (WPF) 元素承载的位置。
protected:
virtual System::Windows::Automation::Peers::HostedWindowWrapper ^ GetHostRawElementProviderCore();
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected virtual System.Windows.Automation.Peers.HostedWindowWrapper GetHostRawElementProviderCore();
protected virtual System.Windows.Automation.Peers.HostedWindowWrapper GetHostRawElementProviderCore();
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
abstract member GetHostRawElementProviderCore : unit -> System.Windows.Automation.Peers.HostedWindowWrapper
override this.GetHostRawElementProviderCore : unit -> System.Windows.Automation.Peers.HostedWindowWrapper
abstract member GetHostRawElementProviderCore : unit -> System.Windows.Automation.Peers.HostedWindowWrapper
override this.GetHostRawElementProviderCore : unit -> System.Windows.Automation.Peers.HostedWindowWrapper
Protected Overridable Function GetHostRawElementProviderCore () As HostedWindowWrapper
返回
此方法将托管的 hwnd 返回到承载hwnd对象的控件的UI 自动化。
- 属性
注解
此方法将托管的 hwnd 返回到承载hwnd对象的控件的UI 自动化。
与 AutomationPeer 立即承载 hwnd 此方法的元素关联的元素必须重写此方法。
如果未重写此方法,UI 自动化会将 hwnd 作为承载整个应用程序的 HwndSource 的子元素。 通常,你想要重写此默认行为,并将UI 自动化设置为将托管hwnd与它位于Windows Presentation Foundation(WPF)逻辑树中的位置并行放置。
除了在托管方案中,不允许 AutomationPeer 类型重写此方法。
除了重写此方法之外, AutomationPeer 与立即承载 hwnd 元素关联的类型还必须返回 AutomationPeer 强制转换以 IRawElementProviderSimple 响应传入托管 hwnd的WM_GETOBJECT。
若要获取指向的指针 IRawElementProviderSimple,请调用 HostProviderFromHandle。