Solved

.ico file

Posted on 2000-03-25
1
256 Views
Last Modified: 2010-05-18
Greetings,

I want to write a .ico file to local hard disk from an .exe
How do I pack this into the exe and then "unpack" it.

Many thanks,

Mal
0
Comment
Question by:malcx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 2657205
Hi
you can store the extra ico in the apps resource file by following the directions below.
make a new file in notepad that looks like:

 TESTFILE  EXEFILE C:\TEST.ICO

and save file as myres.rc

compile myres.rc with brcc32.exe in delph bin directory to get a file called myres.res .

then in delphi app in your unit do:

{$R *.DFM}

{$R MYRES.RES}//add file here

procedure ExtractRes(ResType, ResName, ResNewName : String);
      var
        Res : TResourceStream;
      begin
        Res := TResourceStream.Create(Hinstance, Resname, Pchar(ResType));
        Res.SavetoFile(ResNewName);
        Res.Free;
      end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ExtractRes('EXEFILE','TESTFILE','C:\TEST_ICO_FROM_RES.ICO');
end;


now when project is build the ico is added to the applications exe fiel and when you want to extract it to the hard disk just do the button click.

Regards Barry
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question