Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


I need a SHORT example to extract the main icon from EXE.

Posted on 1999-07-31
Medium Priority
Last Modified: 2010-04-04
I need a SHORT example to extract the main icon from EXE.
(or from any file with icon resources)
Question by:cosminm
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
  • 2

Accepted Solution

yingkit earned 200 total points
ID: 1392180
uses ....,ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
   FileName: AnsiString;
     FileName := 'c:\sample.exe';
     Image1.Picture.Icon.Handle:=ExtractIcon(Hinstance, pchar(FileName), 0);

Good luck.


Expert Comment

ID: 1392181
And then you can save the icon by using the procedure image1.picture.savetofile.

Author Comment

ID: 1392182
So easy!... Thanks.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

670 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