troubleshooting Question

Getting the images from all file extensions. such as pdf, .doc and so on

Avatar of Alpha_AI
Alpha_AI asked on
DelphiPascal
7 Comments1 Solution233 ViewsLast Modified:
How do I get the icons that have assigned to all the file types
such as .pdf, .doc, .mpg
and assign those to TImage

I am after the small images and big images.

I know how to get the small images for executable.

       TheIcon := FOrm1.GetSmallIconFromFile(Trim(Data^.Type1),0);
        if TheIcon <> nil then
          begin
          TImage(((Form1.FindComponent('Edit'+Data^.Meaning2) as TEdit).Parent).Controls[i]).Picture.Assign(TheIcon);      // assign the icon to the TImage that exists on the panel
          end;

function TForm1.GetSmallIconFromFile(FName: String; idx: Word): TIcon;
var
  LargeIcon : Hicon;
  SmallIcon : Hicon;
  Icon : TIcon;
begin
Icon := TIcon.Create();
   ExtractIconEx(PChar(FName), idx, LargeIcon, SmallIcon, 1);
   if SmallIcon <= 1 then
     begin
     Icon.Handle := SmallIcon;
     Result := Icon;
     end
   else begin
     Icon.Handle := LargeIcon;
     Result := Icon;
  end;

ive tried to pull a image from many of the other file extension other than .exe and i cant rip it out.

Whats the solution?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros