Http://www.cnblogs.com/dabiao/archive/2009/11/28/delphi.html
1. Create RC file. Can be written in any text editor. The file format is: Resource Name resource type file name.
For the resource type, if it is an EXE file, it should be exefile, or rcdata if it is a binary file.
Here to create a file float.rc:
Aexe exefile "E:\Software\float.exe"
2. Convert this rc file to res file.
Copy float.rc to the Bin folder in the Delphi installation directory, execute BRCC32 float.rc, generate Float.res
3. Include the res file in the project file.
{$R float.res}
4. Extract the Float.EXE in Res.
Code highlighting produced by Actipro Codehighlighter (freeware) http://www. Codehighlighter.com/--> 1procedure Tformmain.ieee7541click (sender:tobject); 3 var t:tresourcestream; Begin 7 if FileExists (' Float.exe ') then winexec (' Float.exe ', sw_normal) else begin Try t: = Tresourcestream.create (hinstance, ' aexe ', ' exefile ');//Where hinstance is a handle constant ; Rwww is the resource name; Exefile is the resource type t.savetofile (' Float.exe '); Finally T.free; End; WinExec (' Float.exe ', sw_normal); End End
In this way, it is possible to invoke another EXE program in an EXE file.
Embed another EXE file in the Delphi EXE file