Get MainWindowHandle of spawned process in .NET Core
问题 I have this code: private static void Start(String path) { var process = Process.Start(new ProcessStartInfo(path) { WindowStyle = ProcessWindowStyle.Maximized, UseShellExecute = true, }); ThreadPool.QueueUserWorkItem(Tick, process); } private static void Tick(Object obj) { var process = (Process) obj; while (true) { Debug.WriteLine($"HWND: {process.MainWindowHandle}"); Thread.Sleep(TimeSpan.FromMilliseconds(10)); } } This starts a process and then displays the MainWindowHandle property every