foreach (var hwnd in EnumerateProcessWindowHandles(Process.GetProcessesByName("Procces").First().Id))
{
if (GetWindowClassName(hwnd).StartsWith("Class"))
{
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, "PokerStarsChatClass", "");
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();
string stol1 = Convert.ToString(hwndchat);
Console.WriteLine(stol1);
}
else
{
Console.WriteLine("Не найдено дочернего окна");
}
}
}
В переменную stol1 записывается хэндл последнего найденного окна, а как быть с другими?