Einzelnen Beitrag anzeigen

Thebe

Registriert seit: 25. Jul 2004
Ort: Wedel
78 Beiträge
 
Delphi 6 Enterprise
 
#1

Problem mit SHGetFileInfo und SHGFI_ICONLOCATION

  Alt 13. Sep 2005, 11:24
Moin

Ich hab folgenden Code

Delphi-Quellcode:
var
  fi: SHFileInfo;
begin
  AFile := 'C:\irgendeine.bmp';

  SHGetFileInfo(pChar(AFile), 0, fi, SizeOf(fi), SHGFI_ICONLOCATION)

  // SHGFI_ICONLOCATION = Retrieve the name of the file that contains the icon representing the file specified by pszPath, as returned by the IExtractIcon::GetIconLocation method of the file's icon handler. Also retrieve the icon index within that file. The name of the file containing the icon is copied to the szDisplayName member of the structure specified by psfi. The icon's index is copied to that structure's iIcon member.
end;
Problem ist nur: szDisplayName beinhaltet nicht wider Erwarten nach der MSDN den Namen der Datei, wo das Icon abgespeichert is, sondern ist einfach nur leer. Ich habe erst gedacht ich hätte bei der weiteren Weiterverarbeitung nen Fehler beim Typecast gemacht, doch nachhem gesetzten Haltepunkt zeigt Delphi mir auch an das fi.szDisplayName komplett leer ist.

Woran kann sowas liegen ? Bin ich zu blöd nu drei bzw. vier Parameter zu übergeben oder liegt das anner WinAPI ?

MfG
- Thebe
  Mit Zitat antworten Zitat