ShGetFileInfo and small icons...

how can I use the SHGetFileInfo to retrieve the small icon and assign it to the applications icon

thank you
Rouge
rougeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BoRiSConnect With a Mentor Commented:
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
 
BoRiSCommented:
oops sorry that was surposed to be sent as a comment, you may reject this answer if you wish...

Later
BoRiS
0
 
rougeAuthor Commented:
Thank you BoRiS, this is what I needed just a short question can I assign the smallicon to an image component...

Rouge
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.