Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Explorer-like sample or SHGetFileInfo GetType question

Posted on 2001-06-21
3
Medium Priority
?
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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 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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

721 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