Click here to Skip to main content
15,898,946 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to embed mspaint.exe, notepad.exe, calc.exe or any application just like user control in windows form using c#.
Posted

Are you sure you want to do this? You don't know the depencies of the executables. Notepad for example may work, but you cannot just embed for example MsWord.exe and expect the executable to work.

If you want to run software on any target machine, I think it's wise to check for existance of the executable and only execute the file if it exists.

C#
if (File.Exists("Path\\To\\Notepad.exe"))
{
  // Start the new notepad process...
}
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Mar-11 12:09pm    
A agree, my 5; please see the alternative in my Answer.
--SA
It's easier to implement the feature of MSPaint (but it does not pay off, such a bad program!) or calculator (what's good about it?) from scratch then embed it smoothly.
Do the following: find some good code for application you need and uses the source code. CodeProject is a good source if source codes like that.

—SA
 
Share this answer
 
v2
Comments
avigodse 22-Mar-11 12:42pm    
Yes i agree with eduard.
I just tried un help the person further,as that might be a requirement.
But Mister SA, You continue to stalk me, and down vote my answers, thanks a lot.
I would not take advance to downgrade notepad and mspaint.
Authority please look into matter.
Sergey Alexandrovich Kryukov 22-Mar-11 14:12pm    
I agree with Eduard, too and this is my alternative, quite practical.
The point of my answer is offering better alternative, not opposing anyone.
If you want to look into matter yourself (and make me to), please explain your opinion, I'll respectfully consider it.
--SA
This might help you.
embed_executable_tutorial
Using this solution, it will extract the embedded files to your application root, to execute you should use
System.Diagnostics.Process.Start("extracted file path here");

Hope this'll cater what you need.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900