Share via


IXRVisualHost::GetFocusedElement (Compact 2013)

3/28/2014

This method retrieves the element in the visual tree that currently has the UI focus.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetFocusedElement(
    IXRFrameworkElement** ppFocused
) = 0;

Parameters

  • ppFocused
    [out] Address of a pointer to the IXRFrameworkElement object that represents the UI element that currently has the UI focus.

Return Value

Returns S_OK if successful; otherwise, returns standard HRESULT values as appropriate or the values described below.

Value

Description

XR_E_INVALID_STATE

This method was called on an object in an invalid state, such as a host that was already destroyed or a dialog box that was closed without calling EndDialog.

XR_E_INVALID_THREAD_ACCESS

This method was called from a different thread than the thread on which the system was initialized. A visual host can only be accessed on the thread that it was created on. Most XAML for Windows Embedded APIs can be accessed only from a single thread.

Remarks

This method adds a reference on the object returned in ppFocused, and the caller is responsible for releasing the reference on the object.

To use a specific interface pointer type, you can use the helper template version of this method that XAML for Windows Embedded provides. When you supply a derived type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic interface so you do not have to explicitly call IUnknown::QueryInterface to convert the generic interface into the required object type.

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRVisualHost