Solved

Explorer-like sample or SHGetFileInfo GetType question

Posted on 2001-06-21
3
232 Views
Last Modified: 2013-11-20
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.

0
Comment
Question by:yoavo
  • 2
3 Comments
 
LVL 2

Expert Comment

by:mirec
ID: 6218149
Try MSDN topic:
DirLV Sample Populates a ListView Control Similar to Explorer

m.
0
 
LVL 2

Accepted Solution

by:
mirec earned 50 total points
ID: 6218161
0
 

Author Comment

by:yoavo
ID: 6222381
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 ?

 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 90
Separate files macro - Errors on larger data set 18 65
sum28 challenge 31 105
Sed question 2 68
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now