Click here to Skip to main content
15,174,684 members
Articles / Desktop Programming / ATL
Posted 11 Mar 2004


37 bookmarked

VS File Finder

Rate me:
Please Sign up or sign in to vote.
4.90/5 (39 votes)
8 May 20053 min read
A Visual Studio add-in to help navigate around large projects.

Sample Image - VSFileFinderScreenShot.gif


VS File Finder is a Visual Studio .NET 2003 Add-In that helps you find files quickly in large projects. It is written in C++ and can list files from all the project types that Visual Studio supports.

After installing, you will see a new window in the IDE listing all the files in your current solution. By typing a few letters from any part of a filename, you can quickly narrow down the list to just a few files and then open the file you are interested in.

This is more useful than the Solution Explorer or the file open dialog in large projects as files can be spread over many folders and you might only remember part of a file name.

There are options to highlight or exclude files based on the file name so you can quickly get to the files you want.


The add-in should work well with projects written in any of the languages Visual Studio .NET supports. I have tested the add-in with C++, C# and VB.NET projects.

The add-in works with Visual Studio .NET 2003 (version 7.1). It does not work with Visual Studio .NET 2002, Visual Studio .NET 2005 beta or any previous version of Visual Studio. Adding support for VS2002 or VS2005 may be as simple as changing the registration code to list the add-in as working with those versions or it may require some code changes (I don't have access to either of these versions to find out).


The add-in uses the Visual Studio .NET automation interface to find the files in the project and to display its window.

It took a long time to find a method of building the file list that was both quick and reliable. I started with a version that built a list of files and then tried to use the solution events to update the list whenever the project changed. This method didn't work that well as some actions (like loading a solution) can cause a lot of events to be triggered and some actions don't generate events or send events that are too generic to work out their effect on the list of files. I tried adding more and more event handlers but this method seemed doomed to failure.

The method that I now use is to rebuild the list of files on each event. To keep things working quickly, I delay the actual building of the list by a few hundred milliseconds so multiple events will get batched up into one rebuild. The add-in also uses a virtual list control to reduce the amount of flicker when the list changes.

This method seems to work well even with large solutions (I typically use it on a project with two or three thousand files with no problems at all).

Using the code

There are a few bits of code from this project that might be useful for other projects. SolutionExplorer.cpp/.h provides the base class for classes that need to iterate over the files in a solution in a visitor style and hides a lot of the tedious details.

The code also has some useful helper classes for handling Visual Studio events and has some code for displaying and sorting a virtual list control.

Points of Interest

The solution is actually built using two projects, a Visual Studio Add-in and an ActiveX control. There seems to be an odd problem with hosting ActiveX controls in Visual Studio when the controls are built using MFC. The control gains an extra border which should not be there. This also happens with simple AppWizard created code as well, so I am wondering if this is an MFC bug. The only solution I could find is to call DestroyTracker in CVSFileFinderCtrl::OnActivateInPlace. This fixes the problem but I would be interested to find out why this is needed.


  • 12 March 2004 - Version 1.0 released
  • 5 April 2004 - Version 2.0 released
    • Fixed issues with C# and VB projects
    • Added options and about dialogs
    • Added exclude filter
    • Added highlight filter
    • Added code to store column widths on exit


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

J W Payne
Web Developer
United Kingdom United Kingdom
No Biography provided

Comments and Discussions

SuggestionPlease mention the tool usage . Pin
krravisha17-Sep-13 20:17
Memberkrravisha17-Sep-13 20:17 
SuggestionQuick Open File - For VS2010 Users Pin
lotusdust6-Apr-12 10:22
Memberlotusdust6-Apr-12 10:22 
QuestionSource files navigation Pin
Grotichaz Morek29-Jul-07 11:58
MemberGrotichaz Morek29-Jul-07 11:58 
QuestionAdd the new project types Pin
karabagamoorthy16-Nov-06 1:17
Memberkarabagamoorthy16-Nov-06 1:17 
GeneralNew version with Visual Studio 2005 support Pin
J W Payne10-Jun-06 11:18
MemberJ W Payne10-Jun-06 11:18 
GeneralGreat Work & Small Suggestion Pin
Paul Hooper20-Feb-06 20:12
MemberPaul Hooper20-Feb-06 20:12 
GeneralVersion 3.1.1 Pin
J W Payne8-May-05 5:47
MemberJ W Payne8-May-05 5:47 
GeneralInstaller for VS 2005 Beta 2 Pin
Mark Levison25-Apr-05 9:18
MemberMark Levison25-Apr-05 9:18 
GeneralRe: Installer for VS 2005 Beta 2 Pin
J W Payne25-Apr-05 9:54
MemberJ W Payne25-Apr-05 9:54 
GeneralRe: Installer for VS 2005 Beta 2 Pin
Mark Levison6-May-05 5:52
MemberMark Levison6-May-05 5:52 
GeneralRe: Installer for VS 2005 Beta 2 Pin
J W Payne8-May-05 5:45
MemberJ W Payne8-May-05 5:45 
GeneralRe: Installer for VS 2005 Beta 2 Pin
Pablo Aliskevicius16-Apr-06 0:11
MemberPablo Aliskevicius16-Apr-06 0:11 
GeneralRe: Installer for VS 2005 Beta 2 Pin
J W Payne10-Jun-06 11:15
MemberJ W Payne10-Jun-06 11:15 
GeneralVery Good one Pin
VC Sekhar Parepalli1-Feb-05 20:56
MemberVC Sekhar Parepalli1-Feb-05 20:56 
GeneralRe: Very Good one Pin
J W Payne7-Feb-05 8:47
MemberJ W Payne7-Feb-05 8:47 
GeneralRe: Very Good one Pin
VC Sekhar Parepalli7-Feb-05 9:51
MemberVC Sekhar Parepalli7-Feb-05 9:51 
Thanks Jonathan, my small-changesSmile | :) are
1) To save the auto-hide status , which is not yet there now for this addin.
2) Text and Regex based search across solution..just as you said.
3) To make the behavior configurable : as soon as I click the any link in the search results, again the search field value vanishes resetting back everything again.

Smile | :)

GeneralRe: Very Good one Pin
J W Payne8-Feb-05 2:39
MemberJ W Payne8-Feb-05 2:39 
GeneralRe: Very Good one Pin
VC Sekhar Parepalli8-Feb-05 20:07
MemberVC Sekhar Parepalli8-Feb-05 20:07 
GeneralRe: Very Good one Pin
J W Payne10-Jun-06 11:16
MemberJ W Payne10-Jun-06 11:16 
GeneralSuggestion Pin
Uwe Keim19-Jan-05 2:32
sitebuilderUwe Keim19-Jan-05 2:32 
GeneralSolution on unmodeled projects Pin
Ad016-Dec-04 13:29
MemberAd016-Dec-04 13:29 
GeneralProblem with Auto-Hide Pin
Urs Eichman8-Nov-04 22:06
MemberUrs Eichman8-Nov-04 22:06 
GeneralVersion 3.1 Pin
J W Payne12-Jun-04 12:13
MemberJ W Payne12-Jun-04 12:13 
GeneralRe: Version 3.1 Pin
huzzaboo18-Jun-04 10:58
Memberhuzzaboo18-Jun-04 10:58 
GeneralMinor feature request Pin
huzzaboo11-Jun-04 8:22
Memberhuzzaboo11-Jun-04 8:22 

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.