Jump to content

UIautomation treewalker


Recommended Posts

I've been trying to step through the elements of a listbox using a treewalker but have had no success. The GetFirstChildElement succeeds  and returns the first element, but when I issue the GetNextSibling call, the program faults.

Does someone have an working example ?

Link to comment
Share on other sites

I think I found my problem. and I have succeeded in getting at least once call to GetNextSibling to work.  My code had an already had an element interface object lying around (from ObjCreateInterface) when I called GetNextSibling in the treewalker object using the element id from GetFirstElement.  I seems that trying to create a second element interface object from the same element id, gets things screwed up, and I believe that passing an element id to and uiiautomation function does an implicit create interface.

Changing my code to pass the first interface object to GetNextSibling seemed to work.

I'll experiment some more.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...