UIAutomation-Interop icon indicating copy to clipboard operation
UIAutomation-Interop copied to clipboard

desktop.GetLastChild() return too slow

Open ym9288 opened this issue 11 months ago • 0 comments

I use code like this: IUIAutomation uia = new CUIAutomation8(); var desktop = uia.GetRootElement();

var walker = uia.RawViewWalker; List<IUIAutomationElement> result = new List<IUIAutomationElement>();

IUIAutomationElement tmp = walker.GetFirstChildElement(current); while (tmp != null) { if(condition == null || condition.Verify(tmp)) { result.Add(tmp); } tmp = walker.GetNextSiblingElement(tmp); }

when tmp to be set as the last child , then call walker.GetNextSiblingElement(tmp), it would be a long time to return null.

Or call: desktop .GetLastChildElement(), it speed too much time to return.

How can I quickly get all children of desktop ? Thanks very much.

ym9288 avatar Mar 10 '25 17:03 ym9288