Einzelnen Beitrag anzeigen

Benutzerbild von Jens Schumann
Jens Schumann

Registriert seit: 27. Apr 2003
Ort: Bad Honnef
1.644 Beiträge
 
Delphi 2009 Professional
 
#2

Re: Dateiicon ermitteln schlägt fehl

  Alt 9. Mär 2008, 16:57
Hallo,
versuche es mal damit.
Delphi-Quellcode:
procedure GetAssociatedIconEx(const Filename : String; Icon : TIcon);
var
  SHFileInfo: TSHFileInfo;
begin
  FillChar(SHFileInfo, SizeOf(TSHFileInfo), 0);
  if (SHGetFileInfo(PChar(Filename), FILE_ATTRIBUTE_NORMAL, SHFileInfo,
    SizeOf(TSHFileInfo), SHGFI_USEFILEATTRIBUTES or SHGFI_ICON or SHGFI_SMALLICON) <> 0) then
  try
    Icon.Handle := CopyIcon(SHFileInfo.hIcon);
  finally
    DestroyIcon(SHFileInfo.hIcon);
  end;
end;
I come from outer space to save the human race
  Mit Zitat antworten Zitat