Solved

ShGetFileInfo and small icons...

Posted on 1998-12-08
3
149 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
[X]
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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

635 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