AutomationPeer.GetHostRawElementProviderCore 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
告訴 UI 自動化在 UI 自動化樹中,該將 Windows Presentation Foundation(WPF)元素託管 hwnd 在哪裡。
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 物件的控制項。
- 屬性
備註
此方法將託管的 hwnd 回傳給 使用者介面自動化,以取得承載 hwnd 物件的控制項。
AutomationPeer the 是與一個元素相關聯,該元素立即承載 必須hwnd覆寫此方法。
如果這個方法沒有被覆寫,使用者介面自動化會將 hwnd 作為承載整個應用程式的 HwndSource 的子元素。 通常你會想覆寫這個預設行為,並將 使用者介面自動化 設定為將託管的 hwnd 平行放置於 Windows Presentation Foundation(WPF)邏輯樹中的位置。
除非在主機情況下,否則不應允許 AutomationPeer 類型覆蓋此方法。
除了覆寫此方法外, AutomationPeer 與直接承載 和 hwnd 的元素相關聯的類型,必須回傳 AutomationPeer 投射到 的 IRawElementProviderSimple ,以回應 WM_GETOBJECT 進入 hwnd。
若要取得指向 IRawElementProviderSimple的指標,請呼叫 HostProviderFromHandle。