Solved

.ico file

Posted on 2000-03-25
1
257 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month3 days, 18 hours left to enroll

630 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