[Accessibility-ia2] Recursively finding the object containing the caret is painfully slow.

Arnstein Skåra arnstein at lingit.no
Fri Dec 3 17:07:37 PST 2010


A brief description of the current situation:
1.Place caret within a paragraph.
2.Get the focused IAccessible object.
3.Traverse it's children to find the IAccessible2 object containing the caret.

This approach is how you are supposed to do it, according to the implementation guide.
It is a very time consuming operation. An example of how bad it can get is www.inetword.com.

Alexander Surkov proposed a method to deal with it:

[propget] HRESULT accessibleWithCaret ([out, retval] IUnknown **accessible);

Returns the accessible object containing the caret.  If the caret is in
an accessible in a tree of accessibles the returned accessible is the
one actually containing the caret, i.e. a leaf node in the
accessibility tree.


     [out] accessible   The returned accessible contains the caret.

Returned Values:

     S_FALSE   if there is no accessible in the entire accessible hierarchy containing a caret

- Arnstein

More information about the Accessibility-ia2 mailing list