Solved

ShGetFileInfo and small icons...

Posted on 1998-12-08
3
145 Views
Last Modified: 2010-04-04
how can I use the SHGetFileInfo to retrieve the small icon and assign it to the applications icon

thank you
Rouge
0
Comment
Question by:rouge
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
BoRiS earned 100 total points
ID: 1349812
rouge

you could try somethng like this...

procedure TForm1.Button1Click(Sender: TObject);
       var
             SmallIco: TIcon;
             shfi: TShFileInfo;
           begin
             SmallIco := TIcon.Create;
              ZeroMemory(@shfi, SizeOf(shfi));
               ShGetFileInfo('D:\Windows\notepad.exe', 0, shfi, SizeOf(shfi), SHGFI_SMALLICON or SHGFI_ICON);
                 SmallIco.Handle := shfi.hIcon;
                   Application.Icon := SmallIco;
                    SmallIco.Free;
           end;

hope this helps....

Later
BoRiS
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1349813
oops sorry that was surposed to be sent as a comment, you may reject this answer if you wish...

Later
BoRiS
0
 

Author Comment

by:rouge
ID: 1349814
Thank you BoRiS, this is what I needed just a short question can I assign the smallicon to an image component...

Rouge
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

806 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