Most of us on Windows are using built-in Windows explorer to browse through their file system. Even though, it's a very useful one in exploring our system but it won't be helpful for easy navigation. It won't allow us to browse files easily, do search with a key stroke, smart navigation etc. So, I thought of doing an application that makes our file system exploration easy and fast. First, I will explain the features of this application followed by its design and coding.

Features provided by this Explorer:

I designed this application in VS 2008 SP1. Create a new Windows application in C# and name it as FileSystemExplorer. Add the controls to Explorer form as shown below:

1.gif

Purpose of above controls:

Design the Main menu and Context Menu with below menu items:

2.gif

Now, add a new form called as Search with below Design:

3.gif

Purpose of above controls:

Add a new class and name it as FileSysItems. This class is used to display path in the form of link labels. Link labels will be added using control array concept.

We are done with the design. Now, let's dig into the functionality part of this application. I will outline the steps performed by it.

  1. When we run the application, it loads all drives.
  2. Based on selected drive and folder, it will create the path using links for easy navigation and displays the contents of selected folder.
  3. We can do the search by using Search form. It will filter out the folders and files based on search text and display it on the fly in Explorer.
  4. We can bookmark a path using Bookmark It menu item.

Let's go into the coding part. I will outline the important methods.

I will explain the core method (SearchFItems) for search functionality. In order to make application respond to user interactions while doing a search, I had implemented search on a separate thread using ThreadStart and Thread classes.

4.jpg
5.jpg

Here, we are looping through all directories, files and filtering those using search text entered. We are using SHGetFileInfo function to get file icon by passing full file name to it. Finally, we are adding it to image list. This icon will be displayed along with file name in Explorer. We can even enter a folder or file path for exploring using Search form, it will provide auto suggestion using file system as a source. This search form will helps us a lot in filtering, opening files, browsing folders easily and quickly.

I added some more code to improve the UI and functionality. Finally, the application looks like below:

6.gif

We can still enhance this application by adding UI and extra functionality like copy/paste of items, better performance etc. I am attaching source code for reference. I hope this article will be helpful for all.