atbowler Posted July 10, 2017 Posted July 10, 2017 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 ?
atbowler Posted July 12, 2017 Author Posted July 12, 2017 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now