thanks..im searching for the right answer but still not got it.. my question:
- i want to run an exe file on my winform .net application within the panel using c# code
- im able to run exe file on the button click with
System.Diagnostics.ProcessStartInfo
andProcess p = Process.Start("notepad.exe");
but what is the code to run this notepad file or any other exe file within the panel using c# code? i want to run the application within the pannel not on the seperate window.i had run the following code but the exe does not stay on the screen nor it opens within the panel please tell me the solution for this..
Process p = Process.Start("notepad.exe"); Thread.Sleep (600); // Allow the process to open it's window SetParent(p.MainWindowHandle, panel1.Handle); [DllImport("user32.dll")] static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);