views:

467

answers:

2

how to embed third party exe within the panel of my c#.net program by panel i mean a toolbox control that is drag and droppred in the winform.

+1  A: 
Marc Gravell
Waiting 12 minutes for the dialog is a feature, not a bug!
Aaronaught
thanks for ur answer but i need to run the exe in the panel of my own running c#.net program. eg i have an exe named e-recording.exe saved in the d drive of my computer then what is the procedure to call it within the panel and run that application.i mean its not a static application its an executable file i want to execute it within the panel not on the seperate window
@unknown - then I suggest you clarify the question; it *sounds* like you are talking about the IDE...
Marc Gravell
i had run the following code but how to do the same thing for another exe application not the part of the inbuilt OS app. like notepad. Process p = Process.Start("notepad.exe"); p.WaitForInputIdle(); SetParent(p.MainWindowHandle, panel1.Handle); MoveWindow(p.MainWindowHandle, 0, 0, panel1.Width, panel1.Height, false); [DllImport("user32.dll")] static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); [DllImport("user32.dll")] private static extern bool MoveWindow(IntPtr hwnd, int x, int y, int w, int h, bool repaint);
the code i have given is only for win32.dll exe files that are already in the OS. like notepad,calc,etc. but i want to call another application for my project. is there any possible way??please help!!
@unknown - where does the code you have break down? In general, though, this approach is *going* to be hard. Much easier to host (for example) an ActiveX control.
Marc Gravell
+1  A: 

These two articles in codeproject will be the answer to your question.

http://www.codeproject.com/KB/miscctrl/AppControl.aspx

http://www.codeproject.com/KB/cs/WindowTabifier.aspx

The first article is more basic and probably the best place to start. The 2nd is more advance and show how you can most multiple application exes in your code. I just come across it as well and I think it is awesome!

Fadrian Sudaman