您可以使用 Process 类。Process[] processes = Process.GetProcessesByName("someName"); foreach (Process p in processes) { IntPtr windowHandle = p.MainWindowHandle; // do something with windowHandle }