try
{
var windows = new List<IntPtr>();
foreach (var hwnd in EnumerateProcessWindowHandles(Process.GetProcessesByName("processXXX").First().Id))
{
if (GetWindowClassName(hwnd).StartsWith("XXXClass"))
{
windows.Add(hwnd);
Console.WriteLine("Finded Name: " + GetWindowName(hwnd));
Console.WriteLine("Finded Class: " + GetWindowClassName(hwnd));
Console.WriteLine(hwnd);
Console.WriteLine();
IntPtr hwndchat = FindWindowEx(hwnd, IntPtr.Zero, "XXXchildClass", "");
if (hwndchat != IntPtr.Zero)
{
Console.WriteLine("Finded child Name: " + GetWindowName(hwndchat));
Console.WriteLine("Finded child Class: " + GetWindowClassName(hwndchat));
Console.WriteLine(hwndchat);
Console.WriteLine();
Console.WriteLine();
}
else
{
Console.WriteLine("Не найдено дочернего окна");
}
}
}
}
catch
{
Console.WriteLine("Не запущен");
}
Стал вопрос о присвоении каждому дочернему окну своего указателя