Embed another EXE file in the Delphi EXE file

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.