Page 1 of 1

SHGetFileInfo API translation

Posted: Wed Apr 09, 2008 9:00 am
by hua
I want to display a list of filenames along with their icons and I found out SHGetFileInfo can be used to obtain them. Could someone help me translate the VB code that can be found here and here?

Hopefully inch by inch I can get closer to what my boss wants, something that's similar to Views icon in Windows Explorer.

TIA

API-Function

Posted: Wed Apr 09, 2008 2:26 pm
by ukoenig
Hello,
There is the FW-Function for the API

Code: Select all


DLL32 FUNCTION SHGetFilIn;
     ( pszPath AS STRING, ;
     dwFileAttributes AS LONG, ;
     @psfi AS LPSTR, ;                    // SHFILEINFO
     cbFileInfo AS LONG, ;
     uFlags AS LONG ) ;
     AS LONG PASCAL; 
     FROM "SHGetFileInfoA" LIB "SHELL32"


STRUC oSHFILEINF
   MEMBER hIcon AS LONG
   MEMBER iIcon AS LONG
   MEMBER dwAttributes AS LONG
   MEMBER szDisplayName AS STRING
   MEMBER szTypeName AS STRING
END STRUC


Regards

Uwe :lol:

Posted: Thu Apr 10, 2008 2:06 am
by hua
Thanks Uwe. I'll give it a try