03-20-2025, 05:58 AM
Using just Interop.UIAutomationClient from FlaUI:
// script "test Interop.UIAutomationClient.cs"
/*/ nuget -\Interop.UIAutomationClient; /*/
using UIA = Interop.UIAutomationClient;
var uia = new UIA.CUIAutomation8Class() as UIA.IUIAutomation;
var w1 = wnd.find(1, "CapCut", "Qt622QWindowIcon");
var ew1 = uia.ElementFromHandle((nint)w1);
var condition = uia.CreatePropertyConditionEx(30159, "HomePageDraftTitle:0319", 0);
var e2 = ew1.FindFirst(UIA.TreeScope.TreeScope_Descendants, condition) ?? throw new NotFoundException();
e2.GetClickablePoint(out var p2);
mouse.click(p2.x, p2.y);