Solved

ShGetFileInfo and small icons...

Posted on 1998-12-08
3
144 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now