I am currently building an application that includes a rudimentary
FTP server. I was able to display the directory contents inside a
scroll view while assigning a Folder Icon fro each folder entry and
a generic File Icon for each file element.
I would however prefer to tap into the finder database and poll the
actual icon associated with the files (based on the extension).
Is there a way to do do this?
Practically, no. The icons used by the system are kept in various
places including the default application used to open the file, the
System resource file, kexts, and (seems to change every major
release) some bundle in CoreServices. The best way to do this is use
GetIconRefFromFileInfo() or one of the companion calls in Icons.h.