using System;
using FlaUI.Core;
using FlaUI.UIA3;
using FlaUI.Core.AutomationElements;
using System.Linq;
class Program
{
static void Main()
{
using (var automation = new UIA3Automation())
{
// Find the "Phone Link" application window
var app = FlaUI.Core.Application.Attach("PhoneExperienceHost");
var mainWindow = app.GetMainWindow(automation);
if (mainWindow != null)
{
Console.WriteLine("✅ Phone Link app found!");
// Find the "Messages" list
var messagesList = mainWindow.FindFirstDescendant(e => e.ByClassName("Messages"));
if (messagesList != null)
{
Console.WriteLine("✅ Messages found!");
// Retrieve all message elements
var messages = messagesList.FindAllChildren();
foreach (var msg in messages)
{
Console.WriteLine("📩 Message: " + msg.Name);
}
}
else
{
Console.WriteLine("❌ Messages list not found.");
}
}
else
{
Console.WriteLine("❌ Phone Link app not found.");
}
}
}
}
Sign up here with your email
ConversionConversion EmoticonEmoticon