Click here to Skip to main content
15,503,367 members
Articles / Desktop Programming / ATL
Article
Posted 19 Nov 2003

Stats

428.6K views
13.5K downloads
79 bookmarked

Folder Size Information in the Windows Explorer Details View

Rate me:
Please Sign up or sign in to vote.
4.59/5 (76 votes)
18 Aug 2010CPOL2 min read
This code displays the folder size information in the Explorer's Details view.
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 maybe, 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 from traversing through other files.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
He is a graduate, currently working as a Software Engineer in Bangalore, India. You can reach him at sharan34@yahoo.com

Comments and Discussions

 
GeneralRe: No extra Column after registering dll Pin
Sorri7-May-04 0:48
Sorri7-May-04 0:48 
GeneralRe: No extra Column after registering dll Pin
Mr. GD (Mr.Green)19-Sep-16 7:13
professionalMr. GD (Mr.Green)19-Sep-16 7:13 
Questionhow do I uninstall Pin
Anonymous23-Apr-04 7:14
Anonymous23-Apr-04 7:14 
AnswerRe: how do I uninstall Pin
Poojas29-Apr-04 10:38
Poojas29-Apr-04 10:38 
GeneralRe: how do I uninstall Pin
Anonymous10-May-04 6:42
Anonymous10-May-04 6:42 
AnswerRe: how do I uninstall Pin
TrInAdOr26-Jul-05 6:13
TrInAdOr26-Jul-05 6:13 
GeneralWindows Explorer (Search Files &amp; Folders) Pin
Anonymous17-Apr-04 12:33
Anonymous17-Apr-04 12:33 
GeneralWindows 98 Pin
John T6-Apr-04 8:25
John T6-Apr-04 8:25 
Hello,

The dll does not work in Windows 98 although I
could register the dll successfully.
I am using VC++ 6.0 + SP5 but I can not rebuild
the DLL (more then 200 errors).
Cn anyone help me?

GeneralRe: Windows 98 Pin
Sharan Basappa6-May-04 19:02
Sharan Basappa6-May-04 19:02 
GeneralRe: Windows 98 Pin
rchas9-Feb-05 16:35
rchas9-Feb-05 16:35 
GeneralError Code Pin
Diamondblack22-Mar-04 6:06
Diamondblack22-Mar-04 6:06 
QuestionHow to install... Pin
Rajparikh2-Feb-04 23:45
Rajparikh2-Feb-04 23:45 
AnswerRe: How to install... Pin
Sharan Basappa9-Feb-04 1:06
Sharan Basappa9-Feb-04 1:06 
GeneralRe: How to install... Pin
upcleecher16-Mar-04 8:04
upcleecher16-Mar-04 8:04 
GeneralRe: How to install... Pin
tricotalazan28-Mar-04 2:29
tricotalazan28-Mar-04 2:29 
GeneralSorting for size Pin
orcun colak6-Jan-04 17:20
orcun colak6-Jan-04 17:20 
GeneralRe: Sorting for size Pin
Sharan Basappa30-Jan-04 1:18
Sharan Basappa30-Jan-04 1:18 
GeneralRe: Sorting for size Pin
m_harriss23-May-04 8:29
m_harriss23-May-04 8:29 
GeneralRe: Sorting for size Pin
Anonymous2-Jun-04 17:44
Anonymous2-Jun-04 17:44 
GeneralRe: Sorting for size Pin
Sharan Basappa30-Jan-04 1:18
Sharan Basappa30-Jan-04 1:18 
GeneralWrong Calculation Pin
Parker776-Jan-04 6:29
Parker776-Jan-04 6:29 
GeneralRe: Wrong Calculation Pin
abolistes20-Jan-04 11:55
abolistes20-Jan-04 11:55 
GeneralRe: Wrong Calculation Pin
Sharan Basappa29-Jan-04 17:57
Sharan Basappa29-Jan-04 17:57 
GeneralRe: Wrong Calculation Pin
allynhunt24-Mar-04 10:40
allynhunt24-Mar-04 10:40 
GeneralRe: Wrong Calculation Pin
tricotalazan28-Mar-04 2:25
tricotalazan28-Mar-04 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.