IRawElementProviderFragmentRoot::GetFocus method (uiautomationcore.h)

Retrieves the element in this fragment that has the input focus.

Syntax

HRESULT GetFocus(
  [out, retval] IRawElementProviderFragment **pRetVal
);

Parameters

[out, retval] pRetVal

Type: IRawElementProviderFragment**

Receives a pointer to the IRawElementProviderFragment interface of the element in this fragment that has the input focus, if any; otherwise NULL. This parameter is passed uninitialized.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See also

IRawElementProviderFragmentRoot