ProjectRecources... // 1 extract resources procedure TForm1.Button1Click(Sender: TObject); begin with TResourceStream.Create(HInstance, ‘SnapShot_EXE‘, RT_RCDATA) do begin SavetoFile(‘SnapShot.exe‘); Free; end; end; // Play the wav file
// Package the EXE file into the resource file I. Write RC Script text Create a new notepad and enter exefile1 exefile "myexefile.exe" to save the file as exeres. RC. 2. Compile the RC file into a res resource file
Input in DOS Brcc32 c: \ Users \ Administrator \ Desktop \ exeres. RC // Copy brcc32.exe to the C: \ Windows directory in the delphix \ bin directory
3. Add source files to the Delphi Unit Create a new project and copy the exeres. Res file to the project directory, InImplementationIn {$ R *. DFM: {$ R exeres. Res}
4. Extract the EXE file from the resource file uses classes; ProcedureExtractres (restype, resname, resnewname:String); VaR Res: tresourcestream; Begin Res: = tresourcestream. Create (hinstance, resname, pchar (restype )); Res. savetofile (resnewname ); Res. Free; End;
// Extract the EXE file from the resource file ProcedureTform1.button1click (Sender: tobject ); Begin Extractres ('exfile', 'exefile1', 'c: \ Users \ Administrator \ Desktop \ aaa.exe '); End;
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