IAccessible::get_accFocus

[This is preliminary documentation and subject to change.]

Retrieves the child object that currently has the keyboard focus.

HRESULT get_accFocus(
  VARIANT *pvarChild
);
 

Parameters

pvarChild
[out, retval] Address of a VARIANT structure that will contain information about the retrieved child. If the current object does not contain an object that has keyboard focus, then the vt member is VT_EMPTY. If vt is VT_DISPATCH, then the pdispVal member is the address of the child object's IDispatch interface. If vt is VT_I4, then the lVal member is the child ID.

Return Values

Returns S_OK if successful or a standard COM error code otherwise.

Remarks

Only one object or item within a container can have the focus at any one time. The object with the keyboard focus is not necessarily the selected object.

Note to implementers If the object itself has the keyboard focus, return zero as a VT_I4 type. If a child is an accessible object and has the focus, return the address of its IDispatch interface (a VT_DISPATCH type). Or, if a child has the focus but isn't an accessible object, return the child ID to the child as a VT_I4 type.

See Also

Accessible Object Selection, Focus, IDispatch Interface