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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ?
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 ?
DirLV Sample Populates a ListView Control Similar to Explorer
m.