Retrieving a data file's associated exe icon

Hello Kevin,

Quote
> I know how to retrieve the icon for an exe, but not for a data file.
> The only way I can think of doing this is to look up the exe for the
> data file.  If this is the case, what is the easiest way to find the
> application exe for a given data file?

Here it is:

  hSysImageList := SHGetFileInfo(PCHAR(FileName), 0, shfi,
                     sizeof(TSHFILEINFO), SHGFI_ICON Or
SHGFI_SYSICONINDEX);
  if(hSysImageList <> 0) then begin
        icon := TIcon.Create;
        icon.Handle := shfi.hIcon;
        LImageList.AddIcon(icon);
        ImageIndex := LImageList.Count - 1;
  end;

//Small icon
      hSysImageList := SHGetFileInfo(PCHAR(FileName),0, shfi,
           sizeof(TSHFILEINFO), SHGFI_SYSICONINDEX Or SHGFI_SMALLICON);

Regards

Andrey Telnov (RSD Software, Delphi RAD Components)
r...@tula.net
http://www.rsdsoftware.com