5,137,506 members and growing! (12,814 online)
Email Password   helpLost your password?
Desktop Development » Shell and IE programming » General     Intermediate

Folder Size Information in the Windows Explorer Details view

By Sharan Basappa

This code displays the folder size information in the Explorer's Details view.
VC6, VC7, VC7.1, C++Windows, Win2K, WinXP, Win2003, ATL, VS6, VS, Dev

Posted: 19 Nov 2003
Updated: 20 May 2004
Views: 153,432
Announcements



Search    
Advanced Search
Sitemap
56 votes for this Article.
Popularity: 6.02 Rating: 3.45 out of 5
9 votes, 16.1%
1
2 votes, 3.6%
2
5 votes, 8.9%
3
12 votes, 21.4%
4
28 votes, 50.0%
5

Sample Image - DirSize.jpg

Introduction

In day to day life, when one wants to know the size of a folder, (s)he has to right click on the folder name and has to choose the Properties. Using this DLL, one can view the folder size as one of the columns of the Explorer as shown in the image. We also have the facility to sort according to the folder size. (I did not do anything to sort, it is done by Explorer :))

This class implements the Shell interface called IColumnProvider. Using this interface, one can customize the Explorer's Details view. This class adds one more column to the Details view, which displays the consolidated folder size.

To build this project, you must install Microsoft Platform SDK, or click here [53.5 Kb] to download SHLOBJ.h.

How to Use the DLL

Well, if you build the project, you need not do anything, since the IDE automatically registers the DLL. If demo project is downloaded, then unzip the DLL and register it using the command "regsvr32 <Path of the unzipped DLL>". E.g., Regsvr32 c:\DirSize.DLL, if the DLL is present in C:.

Scope for Further Improvements

This code can be modified to display the number of files/folders in the folder. Or may be you can pack two more classes to display columns for number of files and number of folders into the same DLL to do so.

Performance Issues

When the user selects the "Folder Size" item from the Explorer context menu, the Explorer starts calculating the folder size by traversing all the files and nested folders. First time, it might take some minutes depending upon the contents of the folder. But all the operations are done in the background (Explorer is smart enough!.. Ehh). So this won't stop you in traversing through other files.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Sharan Basappa


He is a graduate currently working as a Software Engineer in Bangalore, India. You can reach him at sharan34@yahoo.com or call at 91-9886019179
Occupation: Web Developer
Location: India India

Other popular Shell and IE programming articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 73 (Total in Forum: 73) (Refresh)FirstPrevNext
Subject  Author Date 
Questionleft click /selection on the file / folder for the pathmembertechbie1:51 2 Aug '07  
GeneralUsing Scripting.FileSystemObjectmemberclharidon0:54 6 Jun '07  
GeneralVista support?memberjordanbowness8:34 5 Mar '07  
GeneralRe: Vista support?memberalpdoruk21:49 20 Mar '07  
GeneralRe: Vista support?memberVikrant for VC++0:33 2 Apr '07  
GeneralRe: Vista support?supporteryarp22:03 12 Apr '07  
GeneralRe: Vista support?memberm7878787:40 16 Nov '07  
GeneralFolder size in MBmemberKala Kasba8:33 30 Nov '06  
GeneralFor newbiesmemberezekiel6549:55 4 May '05  
GeneralRe: For newbiesmemberpinkmoon12:21 30 Jun '05  
GeneralRe: For newbiessussBrio133714:25 30 Jun '05  
GeneralcommasmemberRoman Seltenreich7:16 27 Oct '04  
GeneralRe: commasmemberXun Ding10:33 4 May '05  
GeneralRe: commassussXun ding10:35 4 May '05  
GeneralThanks!memberfuckmeplease19:09 22 Oct '04  
Generalit would be more perfect if you correct just one line~ :)susscutepsy23:02 28 Jul '04  
GeneralShow size in MBmemberwilkinsonrayo10:29 26 May '04  
GeneralRe: Show size in MBmemberZ37213:53 31 May '04  
GeneralRe: Show size in MBmemberSpoony11:44 21 Aug '04  
GeneralRe: Show size in MBmemberJac7514:00 13 Oct '04  
GeneralRe: Show size in MBmemberurd_sheir1:29 3 Oct '06  
GeneralRe: Show size in MBmemberaxelriet7:17 16 May '07  
GeneralRe: Show size in MBmemberperottol3:42 8 Jun '04  
GeneralRe: Show size in MBmemberMXX19:47 26 Dec '04  
GeneralRe: Show size in MBmemberschanka4:53 25 Feb '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 May 2004
Editor: Nishant Sivakumar
Copyright 2003 by Sharan Basappa
Everything else Copyright © CodeProject, 1999-2008
Web12 | Advertise on the Code Project