Simple Shell Extension to Manipulate File Summary Information

Introduction

CSimpleShlExt is a simple shell extension to manage file comments. With this extension, you can add comments to any file very easily (you right-click the file, go to Properties, and then switch to the Summary tab and add comments there) and can export the comments to clipboard in RTF, CSV, and Text formats to paste them into different applications that support these formats.

It's a very small utility. You already know that there are many other tools available for version controlling; these give you much more facilities. The aim of this extension was to have a very small and in-place facility to add the comments and get them on demand, just through a single click.

How to Use It

This is a simple ATL project. For your convenience, go through the following steps if you haven't created a single ATL project so far.

  1. Double-click the SimpleExt.dsw file, or open Visual C++ and open this workspace.
  2. If you don't have Unicode libraries installed, make sure that you have selected "Win32 Release MinDependency" or "Debug" in the build toolbar.
  3. Compile the project.

That's it; trust me. I'm not kidding. Now, right-click any file; you'll find two new options in the context menu. They are:

  • Add Comment
  • Export Comment(s)

Now, if you click the first option (Add Comment), you'll go directly to the Properties->Summary page to enter a file's details. You can enter different comments to different files, and then select multiple files. Again, right-click and select the other option (Export Comment(s)). After that, launch Notepad, Excel, or Word and use Ctrl+V or paste option from the Edit menu and there you go; the comments are there for all the selected files.

Details

If you don't want to get into the details and just want to enjoy it, you can skip this part. But if you don't, there are two classes in this project:

  • CSimpleShlExt: It's the main class that implements the shell extension and context menu options.
  • CFileSummary: This is the file that is used to extract the file comments.

Okay, if you go into the details, you'll find that in NTFS, comments, and other summary details are stored into streams along with the file, but that is not same with MS-Office files, such as Word or Excel files; they are called as compound files and getting the comments stored with them is different than with other files. For further explanation, you can consult MSDN or go to www.google.com.

All the functionality of retrieving the file comments and other summary details is encapsulated in this class. You can use this class in any other project (MFC or non-MFC based as well) to get the comments of files stored. The simple way is this:

CFileSummary fs;
fs.ExtractFileSummary( "c:\\myfolder\\myfile.txt" );
string strComment = fs.GetComments();

Similarly, you can get other details by calling the respective functions of CFileSummary. Life is good, if things get simple, isn't it? Enjoy!



Downloads

Comments

  • Got any Ideas?

    Posted by dblack on 04/04/2006 05:40pm

    I got this to work but had to change the look-up table to access the items. I am using Win2K SP4 and Visual C# 2005
    Thanks in advance,
    Dan
    dblack@dbland.net
    
    original look-up
    switch (oDFI.ID)
    {
        case 2:
            sFileType = oDFI.Value;
            break;
        case 9:
            sFileAuthor = oDFI.Value;
            break;
        case 10:
            sFileTitle = oDFI.Value;
            break;
        case 11:
            sFileSubject = oDFI.Value;
            break;
        case 12:
            sFileCategory = oDFI.Value;
            break;
        case 14:
            sFileComment = oDFI.Value;
            break;
        default:
            break;
    }
    
    
    my look-up
    switch (oDFI.ID)
    {
        case 2:
            sFileType = oDFI.Value;
            break;
        case 9:
            sFileAuthor = oDFI.Value;
            break;
        case 11:
            sFileTitle = oDFI.Value;
            break;
        case 12:
            sFileSubject = oDFI.Value;
            break;
        case 13:
            sFileCategory = oDFI.Value;
            break;
        case 5:
            sFileComment = oDFI.Value;
            break;
        default:
            break;
    }

    Reply
  • Fantastic!

    Posted by Ajay Vijay on 11/03/2004 03:47am

    I really liked that!

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • The open source cloud computing project OpenStack has come a long way since NASA and Rackspace launched it in 2010. Backed by leading technology infrastructure providers including Cisco, Dell, EMC, HP, IBM, Intel, and VMware, OpenStack underpins significant workloads at an increasingly diverse set of organizations, including BWM, CERN, Comcast, eBay, and Wal-Mart. For CIOs engaged in broader programs to win, serve, and retain customers -- and refocus business technology (BT) spend -- a planned and pragmatic …

  • Enterprises today must focus on digital transformation to remain competitive or disrupt their industries. The foundation for successful transformation is the adoption of a cloud-first mindset. However, IT organizations must first address legacy infrastructure and fragmented management tools that were not designed for the speed and flexibility of the cloud and digital era. Read this IDC Technology Spotlight paper to explore: Why digital transformation is driving a shift to a cloud-centric enterprise Key …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date