Caret Position after Scroll bar moved in MS Word

S

scott.norris13

We are using VC++ 6.0 to interact with MS Word. Our Application is a
HandWriting interpretation and Speech interpretation app that works
with MS Word on the Tablet PC XP OS.


We are experiencing some problems when a user Scrolls up/down the page.



See below.


I use this: hr = AccessibleObjectFromWindow(msg­->hwnd, OBJID_CARET,
IID_IAccessible, &pTemp);


to get the Caret interface of the word document window


and use this: HRESULT hr = pAcc->accLocation(&rc.left, &rc.top,
&rc.right, &rc.bottom, varChild);


to get the Caret position.


In very beginning, it works fine. But If I touch the scroll bar, the
last statement will get hr = S_FALSE. I have check that msg -> hwnd are

same and the first statement return a different interface id. If I keep

using the old id, the second statement still cannot work successful. If

I minimize, then maximize word document, it works again.


Any help would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top