Hosting EXE Applications in a WinForm Project - CodeProject

PHOTO EMBED

Thu Apr 28 2022 08:58:37 GMT+0000 (Coordinated Universal Time)

Saved by @javicinhio #csharp

Process p = null; 
try 
{
  // Start the process 
  p = System.Diagnostics.Process.Start(this.exeName); 

  // Wait for process to be created and enter idle condition 
  p.WaitForInputIdle(); 

  // Get the main handle
  appWin = p.MainWindowHandle; 
} 
catch (Exception ex) 
{ 
  MessageBox.Show(this, ex.Message, "Error"); 
}
content_copyCOPY

https://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-Project