views:

1021

answers:

3

thanks..im searching for the right answer but still not got it.. my question:

  1. i want to run an exe file on my winform .net application within the panel using c# code
  2. im able to run exe file on the button click with System.Diagnostics.ProcessStartInfo and Process 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?
  3. 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);
    
+4  A: 

I think what you are talking about is embedding an application in your panel.

This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.

Oded
thanks...can u provide me the code for any other exe files
zoya
No, no I can't.
Oded
my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
zoya
exe is not stable? What does that mean?
Oded
ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window.tell me by screening my code that i have given..where i have to modify?
zoya
i mean that exe is not stable on the panel of my .net program its appearing on the seperate window..i want to do embedding.
zoya
As I explained, you can't do that with applications that have not been written to do this. And `Process.Start` will _never_ do that for you. You need to find _controls_ that do what you want.
Oded
tell me the solution for calling the third party application in the panel.
zoya
+1  A: 

I guess you are looking for this: Window Tabifier

Giorgi
thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
zoya
can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
zoya
Just read the article. It comes with source code. I cannot do it for you.
Giorgi
tell me the solution for calling the third party application in the panel.
zoya
A: 

What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..

Petoj
thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
zoya