Customize Windows 2000 Folders, to display module information for dlls, exe, etc.
By Toby Allen
Thursday, January 09, 2003
|
Its fairly obvious when looking at Windows 2000 that windows explorer now uses an Internet Explorer interface for displaying details of folders on your machine. If you look closely you will see that this is done by a nice Javascript file behind the scenes that displays details of whatever file you have selected in the panel on the left beside your file listing (not the folder listing).
You may also have found out that you can customise this. If you right click on a folder, and select Customise this folder, you are lauched into a wizard. In the Wizard you can do one of two things, you can select one of the choices that Microsoft provides (which arent very exciting) or choose to customise the template and edit it.
If you choose to customise the template, on the next page of the wizard make sure you check I want to edit this template, this will then pop you up the code for the page in a notepad window, which you can edit to your hearts content and then save.
|
|
Getting it to do something useful.
I played around with this a while ago, and I'm going to share with you all the fruit of my labours. Basically its a slightly modified script for this, that displays the module version, description, module comments etc for a binary that has version information compiled in to it. You can either download it now in text format, and copy it into whatever folder you fancy or (since I know some of you out there are paranoid) I will explain what small changes need to be done to get this to work.
|
|
Do it Yourself
If you want to do it yourself, just find the origional code shown below (I've provided line numbers) and replace it with the code further down. Play about with it a bit as well. You can try getting more values, but I've tried and these are all I can get. If you do get it to display more, let me know.
|
|
Origional Code From Template
The first line of this code starts at line 145 and ends at line 160.
for (i = 4; i < 10; i++) {
title = FileList.Folder.GetDetailsOf(null, i);
if (!title)
break;
data = FileList.Folder.GetDetailsOf(item, i);
if (title == L_Attributes_Text)
text += "<p>" + title + ": " + FormatAttributes(data);
else if (data) {
var safeData = SanatizeString(data);
if (title == "Author") {
gFoundAuthor = true;
text += "<p>" + title + ": <a href='mailto:" + safeData + "'>" + safeData + "</a>";
}else
text += FormatDetail(title, safeData);
}
}
|
|
Code I replace it with
I've started all the changes I've made with Toflidium, so they're easier to find.
//{Toflidium: This is the begining of the changes I make, the section i < 40
// was i < 10, 40 is a arbitrary number I picked, basically its large enough
// to find most of the other columsn that I want to find, but small enough
// to not take too long.}
for (i = 4; i < 40; i++) {
title = FileList.Folder.GetDetailsOf(null, i);
if (!title){
//{Toflidium: break here has to be commented out. I cant quite remember
// why I did this, but I think its because otherwise it doesnt go through
// all the way up to 40.
// Following that I added the next line, just to give title a value.}
//break;
title = "Not found"
}
data = FileList.Folder.GetDetailsOf(item, i);
if (title == L_Attributes_Text)
text += "<p>" + title + ": " + FormatAttributes(data);
else if (data) {
var safeData = SanatizeString(data);
if (title == "Author") {
gFoundAuthor = true;
text += "<p>" + title + ": <a href='mailto:" + safeData + "'>" + safeData + "</a>";
}
//{Toflidium: This is the bit that does the formatting, and as you can see,
// You could change it yourself easy, or try formatting for some of the other
// values displayed. Basically if the title of the column matches a string
// value I set the font to a particular colour.}
else if (title == "Module Version")
{
text += "<p> " + title + ": <Font color='red'><I>" + safeData + "</I></FONT>";
}
else if (title == "Module Description")
{
text += "<p> " + title + ": <Font color='navy'>" + safeData + "</FONT>";
}
//{Toflidium: This is the origional else statement that I've added to
// - Thats it no more changes.}
else
text += FormatDetail(title, safeData);
}
}
|
|
Side Effects
Now that I've shown you how to do it, I'd better tell you about the side effects. The only one, I've been able to find, is that on any folder where you do this change the links that usually come up to mycomputer, favorites etc before you click on a file - no longer do.
I hope you find this useful, please let me know if you do, or if you make any changes that make it more useful. |
Comment on this article in the forums