Process p = Process.Start("E:\\..\\..\\setup.exe");
// Wait for the process to initialize
// p.WaitForInputIdle();
while (p.MainWindowHandle == IntPtr.Zero)
{
Thread.Sleep(100); // Give the process time to start
p.Refresh(); // Refresh the handle
}
// Embed it into a WinForms panel
SetParent(p.MainWindowHandle, panel1.Handle); // panel1 is a WinForms panel
// Optional: Remove borders
uint style = GetWindowLong(p.MainWindowHandle, GWL_STYLE);
SetWindowLong(p.MainWindowHandle, GWL_STYLE, (style | WS_VISIBLE | WS_CHILD));
Sign up here with your email
ConversionConversion EmoticonEmoticon