-2

I have a process with GetProcessesByName("" + Path,"X.X.X.X") and I need to know the handle of the window which is launched from it.

How can I do this?

Christoph Fink
  • 22,727
  • 9
  • 68
  • 113
user3797832
  • 7
  • 1
  • 8

1 Answers1

1

There's MainWindowHandle property which can help you for that :

Process[] processes = Process.GetProcessesByName("yourprocess.exe");

foreach (Process p in processes)
{
    IntPtr windowHandle = p.MainWindowHandle;
}
Perfect28
  • 11,089
  • 3
  • 25
  • 45