Solved

Explorer-like sample or SHGetFileInfo GetType question

Posted on 2001-06-21
3
233 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 42
Expand macro to include alternate header placement and naming 5 72
sum13 challenge 24 107
Problem to open Excel file 15 135
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

803 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