Extract an Icon From Application

Extract an icon from application.

uses shellApi;

procedure TForm1.Button1Click(Sender: TObject);
var
MyIcon : TIcon;
begin
if Opendialog1.Execute then
begin
MyIcon := TIcon.Create;
MyIcon.Handle := ExtractIcon(hInstance, PChar(Opendialog1.filename),0);
DrawIcon(Form1.Canvas.Handle, 10, 10,
MyIcon.Handle);
MyIcon.Free;
end;
end;

This entry was posted in Files. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string tvvo5b to the field below: