In FLAUI trying to get a reference to a child element that starts with some letters or contains some for letters. example start with or "DOC" or contains "DOC" what I'm trying to do is that I'm opening some office files like doc,xls, ppt. and want to attach the file as he is open to the screen.
foreach (var file in listOfFiles)
{
if (file.Name.Contains("DOC") || file.Name.Contains("PPT") || file.Name.Contains("XLS") || file.Name.Contains("TXT"))
{
file.AsButton().Invoke();
var window = new UIA3Automation();
desktopWindow = window.GetDesktop();
desktopWindow = WaitForElement(() => desktopWindow.FindFirstChild(cr => cr.ByName("// Here want to put name that start with ... or contains ...")));
var app = FlaUI.Core.Application.Attach(desktopWindow.Properties.ProcessId);
var application = app.GetMainWindow(new UIA3Automation());
CloseingProcess(application.Name);