How can i add a executable program to my program and run the executeable file in to my program and the program starts with my program :cry:
The shape like this ;

**************************+---+
   *  My Prog v.0.01         |   |
   --------------------------+--\\
   *                             *\\
   *  +---------------------+    *  \\
   *  |The Prog v.9.91      |    *    \\
   *  +---------------------+    *      \\
   *  |                     |    *        \\   |
   *  |                     |    *          \\ |
   *  |                     |    *       -------
   *  |                     |    *             My Program
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                \    |    *
   *  |                 \\  |    *
   *  +-------------------\\+    *
   *                        \\   *
   *                          \\ *
   *******************************
                                  \\
                                    \\  |
                                      \\|
                                   -----+The program that i
                                         want to run in my
                                         program

i'm a new programmer =D if you help me i'll be very happy Thanks for read... :o

Well, if you are planning to just have the second program run, you can call it using:

using System.Diagnostics;
...
Process myProc;
// Start the process.
myProc = Process.Start("filename");

//The process does something.
...

// Stop the process.
myProc.CloseMainWindow();

*code from http://www.codeguru.com/forum/archive/index.php/t-181653.html

It takes filename (your executable) and starts it as a new process.

How can i add a executable program to my program and run the executeable file in to my program and the program starts with my program :cry:
The shape like this ;

**************************+---+
   *  My Prog v.0.01         |   |
   --------------------------+--\\
   *                             *\\
   *  +---------------------+    *  \\
   *  |The Prog v.9.91      |    *    \\
   *  +---------------------+    *      \\
   *  |                     |    *        \\   |
   *  |                     |    *          \\ |
   *  |                     |    *       -------
   *  |                     |    *             My Program
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                     |    *
   *  |                \    |    *
   *  |                 \\  |    *
   *  +-------------------\\+    *
   *                        \\   *
   *                          \\ *
   *******************************
                                  \\
                                    \\  |
                                      \\|
                                   -----+The program that i
                                         want to run in my
                                         program

i'm a new programmer =D if you help me i'll be very happy Thanks for read... :o

Thank you for your reply sfbell;
But i don't want to run a executable file as a new process i want to run it in my program (inside of my program's frame)
Thank you again for your relation...

Is this a windowed application? and is the program you want to run inside the frame already compiled?

Absolutely yes. i've a windowed application code in c# and i want to run a program which is already compiled, inside the frame of my program

Can i ask why? Is the new program an enhancement of the old? Or is the new program using some features of the old? Either way i would make the old program a class library and then it (or parts of it) can be used by many other programs.
Dont be fooled by the fact that you have a UI in the program so it cant be a class library. Hardly any of my .exe files have any UI in them, they are mainly to hold the main controller (i strongly advise looking up the MVC pattern) which then calls various UI's and other libraries depending on the application, the client, the user etc. So much more flexible for now and the future.

you can add the program into yout app as content then extract it and run it with the above mentioned way
u just add the file to your project like any other file then change the build action to content. im noto sure if you can call it directly from the program. i would normaly use this for images and such. but im perdy sure then you can then extract it out of your application

Thank you all for your reply's;
At first i want to explain why i wanna do this, it may be answer to f1 fan's question, i find a program that i think it can powers my project, i couldent find the program's source and i said i'm a new programmer at my first message. The program that i find and which can powers my project is so complex so i cant build a program like this at that level. So i want to run this program like a part of my program! (i dont want someone do that program for me ;))

f1 fan; i understand that you mean if you were me you add the program as a class library but it doesnt work as a class library or i faild to do that. I have to find a way to run my program as a file browser (like web browser)

plazmo; I already can run the program out of my application, i can add the program as a content but i can't call it :cry: yeah i know i'm a bad programmer in fact i'm not a programmer! sorry for take up your time! i'm a hopeless event! :o

Thanks for all again!... :rolleyes:

so you are saying the other program is not yours? But you want to use it in yours? Just one word - LICENSE! No programmer in their right mind is going to grant you a royality free license to do that. You either bought the program yourself so if you keep redistributing it then you are "stealing" from the original developer or you downloaded it which possibly was illegal depending on the source, or the program was freely available but for your use only. If someone releases a program with no source code it means they dont want you to know how they did it. There are ways of getting the source, but i am not going to give them away in here.
In a nutshell you are breaking licensing and probably copyright laws and that (in any country) is a serious offence.
I make my living in IT and i would not hesitate for one second to bring the full force of the law down on anyone profiting from my work. I have staff to pay who have families to feed and you are stealing from them! On saying that, i developed a licensing and anticopying mechanism for just such occassions which works with any .net application with just 3 lines of code.

i know all of them! i'll not change the LICENSE or COPYRIGHT part of the program or i'll not disable them. i jsut want to serve that program in to my program.... Like a patch! i think it's legal. isn't it?

i doubt it is legal. You would almost certainly violate the license agreement

i think what u want to do is impossible since each process has its own memory space.

commented: 4 years too late -1

Please do not resurrect old threads. If you have any questions please ask. .... You are welcome to start your own threads.

Thread Closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.