Upraviť

Zdieľať cez


AutomationPeer.GetHostRawElementProviderCore Method

Definition

Tells UI Automation where in the UI Automation tree to place the hwnd being hosted by a Windows Presentation Foundation (WPF) element.

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

Returns

This method returns the hosted hwnd to UI Automation for controls that host hwnd objects.

Attributes

Remarks

This method returns the hosted hwnd to UI Automation for controls that host hwnd objects.

The AutomationPeer that is associated with an element that immediately hosts an hwnd must override this method.

If this method is not overridden, UI Automation places the hwnd as a child element of the HwndSource that hosts the whole application. Typically, you want to override this default behavior and set UI Automation to position the hosted hwnd parallel to the place where it is located in the Windows Presentation Foundation (WPF) logical tree.

Except in hosting scenarios, do not allow AutomationPeer types to override this method.

In addition to overriding this method, the AutomationPeer types that are associated with an element that immediately hosts an hwnd must return the AutomationPeer that is cast to IRawElementProviderSimple in response to WM_GETOBJECT coming to the hosted hwnd.

To get a pointer to IRawElementProviderSimple, call HostProviderFromHandle.

Applies to

See also