Link to home
Start Free TrialLog in
Avatar of yoavo
yoavo

asked on

Explorer-like sample or SHGetFileInfo GetType question

Hi,
Can someone direct me to an explorer-like sample which uses CListCtrl and fill the list as the explorer does (filename, size, type etc.)
I tried to do this myself, but I have difficulties in getting the file type. I tried to use:

SHGetFileInfo(FileName, 0, &sfi, sizeof(sfi), SHGFI_TYPENAME);

but there are some types of files which the szTypeName field of SHFILEINFO return as empty string though I can see that the explorer show the type of the file.
A sample code of an explorer will realy help...

thanks,
Yoav.

Avatar of mirec
mirec

Try MSDN topic:
DirLV Sample Populates a ListView Control Similar to Explorer

m.
ASKER CERTIFIED SOLUTION
Avatar of mirec
mirec

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yoavo

ASKER

The reason I wanted the sample is that I didnt know what to do when:
SHGetFileInfo(FileName, 0, &sfi, sizeof(sfi), SHGFI_TYPENAME);
returns an empty string for the type. I thought to overcome it by adding to the extention of the file the word: "FILE", but then I thought that I will have location problem (my explorer will not seems nice in japaneese computer for example...).
But I see that MFC sample do the same !!!
How this can be ?