SunnyDesignor
SunnyDesignor
```csharp var app = FlaUI.Core.Application.Attach("xxx.exe"); using (var automation = new UIA3Automation()) { var window = app.GetAllTopLevelWindows(automation).FirstOrDefault(t => t.Name == "Client.Main.Views.AppendViewModel"); window.FindFirstDescendant(t => t.ByName("Accept")).AsButton()?.Invoke(); } ```
GetAllTopLevelWindows is slower, taking 3 seconds, but the new method you provided is effective, reducing the time to 0.2 seconds. Additionally, GetAllTopLevelWindows is not as slow as before, perhaps because...
How do I enumerate it? The code in the loop passes quickly, and the time is concentrated on FindAllChildren. foreach (var element in automation.GetDesktop().FindAllChildren(a => a.ByControlType(FlaUI.Core.Definitions.ControlType.Window))) { element.Name.Dump(); element.FindAllChildren(); }
> > How do I enumerate it? The code in the loop passes quickly, and the time is concentrated on FindAllChildren. foreach (var element in automation.GetDesktop().FindAllChildren(a => a.ByControlType(FlaUI.Core.Definitions.ControlType.Window))) { element.Name.Dump();...