Have you ever thought that navigating in Windows could be much more convenient? Why not add a feature similar to navigating through classes in many modern IDEs, when in the drop-down list triggered by a shortcut, folders with the correct name are displayed, like this:

Once thinking, I wrote a small application called “Navigation Assistant”, shown above. It is available
here , the source code is open, it is free, distributed under the MIT license. I hope it will be useful to anyone.
Why do you need it?
Here are the shortcomings of navigation in Windows Explorer and Total Commander, which, I am sure, cause frustration for many:
- with a large depth of nesting the desired folder you need to make a lot of mouse clicks
- The default search in Windows Explorer is incredibly slow. In addition, to use it, you need to start the explorer itself, click on the search field, type the name of the entire folder or file, and wait a long time
- Total Commander has hints when typing the path in the address bar, but you need to type either the full path or the relative path (relative to the current folder), which is inconvenient
That's why I wrote Navigation Assistant, whose work is similar to navigating the classes or files of many modern IDEs: Ctrl-N and Ctrl-Shift-N in JetBrains products (ReSharper, IDEA, PhpStorm, WebStorm), Ctrl-Shift-T in Eclipse
')
The bonus obtained by using this program is the best directory structure. Many developers, especially those who have read Code Complete, know that the brain copes well with 7 ± 2 objects in working memory; therefore, just as it is useful to limit the number of fields and methods in a class, it is useful to limit the number of subdirectories in a given directory.
With the current state of things this can only be achieved at the cost of inconvenient navigation. When using Navigation Assistant, you no longer have to fear the big nesting of directories.
How to use it?
So far only fast navigation through folders is supported, but not by files.
To quickly get to the desired folder in Windows Explorer or Total Commander (or in any other, but then a new Windows Explorer will be instantiated to navigate) press a special shortcut (Ctrl-Shift-M by default, but you can change it in the settings ). The main application window will appear:

Start typing the name of the folder you would like to get to.
Killer feature: it is not necessary to type the name of the entire folder; for example, to get into Documents and Settings, you can type only "documents and". Moreover, it is not necessary to type the word “documents” entirely, and “doc and” will suffice (hello, JetBrains!); it is also not necessary to type the name of the folder from the first word: “and settings” will also be appropriate. Pascal / camel case is supported specifically for developers: the NavigationAssistant folder will also be assigned to the nav assist search bar.
As a result of these manipulations, a list of suitable directories will appear on the screen:

It remains for you to either select the desired item with the mouse, or use the up / down keys and click Enter (input focus can remain in the text field at this time).
If the window doesn’t please you, you can quickly minimize it to the tray using the Escape key.
If you call the program not in Windows Explorer or in Total Commander, then a new Windows Explorer window will open (with the necessary folder); in the settings you can change the default navigator to Total Commander.
What else is there in it?
There is also a settings window in which you can change
- list of programs to support improved navigation (for example, disable Total Commander)
- default navigation program
- keyboard shortcut to call the window Navigation Assistant
- specify which directories to search in (for example, only in C: \ Users \ or only in D: \)
- in addition, you can exclude certain directory names from the results (for example, bin, obj, .svn)
(more precisely, any path containing the bin folder will be excluded; I note that these are actually regular expressions, so you can specify something like bin \ S *)
- configure the default boot (recommended, because it will not update the internal directory cache every time you start)
For all the options are available tooltips. To get to the settings, just right-click on the tray icon.
How is it done
The utility is written on Microsoft .Net 3.5 using WPF technology, so it should work wherever .Net 3.5 is present.
The installer is written using
Inno Setup , which I wildly recommend to anyone who writes installers: it’s much better than WiX, Install Shield, Visual Studio Installer, because it’s
- free and free
- modular (not tied to Microsoft technology)
- transparent (only text script is edited, no visual programming, as, for example, in Visual Studio Installer)
- as a result, the installer files are not re-created with every change — there are no problems with the version control system
- flexible (supports scripting with Pascal / Delphi). Before that, I saw Delphi last 7 years ago, during my first year at the institute, but the advantages of InnoSetup more than compensate for this disadvantage.
- oh yeah, it magically creates one installation file for x32 and x64 versions
Comparison of installers can be found, for example,
here .
There are several non-trivial points in the code:
Reaction to global keystrokes
In order to show the Navigation Assistant window in time, you need to listen to pressing the key combination globally (that is, in all applications). .Net does not allow this out of the box. Therefore, I used the code
from here (although there are several other solutions, it’s just google global hooks / global hotkeys).
Setting the focus on an inactive application
After we discovered that in some window the cherished key combination was pressed, it is necessary to show the Navigation Assistant and also set the focus to it (to make it active, I mean).
Yes, WPF has a
Window.Activate method that calls WinApi's SetForegroundWindow function, and, therefore, has all its limitations. Namely, if your application is inactive when the method is called, the window will not be made working, that is, the focus will remain in the old window. In fact, this is correct in order not to give malicious programs a sudden change in the current focus and in every possible way impede the work of the user. But in our case, I want to get around this limitation.
The solution helped
from here , although there are several others (
one ,
two ), but they did not work so well.
Integration with Windows Explorer
In order to get a list of open windows windows explorer,
this code was borrowed here. Having a wrapper over a COM object, you can easily change the current path in this explorera window.
Integration with Total Commander
Integration with Total Commander is carried out using
command line options , primarily / O, which sets the path passed with it not in the new Total Commander instance, but in the already open (if there is one).
Architecture
The standard multi-tier architecture is used (an excellent review is in “
Domain Driven Design Quickly Online ” by Avram and Marinescu)
- UI Layer
1. Views
- Presenters Layer
1. Presenters
2. Presentation Services
3. View Models
4. View Model Mappers
- Domain Model aka Business Layer
1. Domain Services
2. Domain Data Objects (plain Data Transfer Objects)
- No Data Access Layer :-)
At first, I tried to use the Model-View-View Model template, but then I switched to
Model-View-Presenter for the following reasons:
- MVP adds an extra level of abstraction Presenters, and without it, all the logic is in View Models, and the latter grow unnecessarily
- This logic should semantically not belong to View Models (single responsibility, that-ce)
- Unable to use interface-driven development (for Views)
- As a result, the UI layer turns to mush (in the sense that there is no separation of duties, modularity, clear interfaces)
Thus, the Model-View-Presenter is now used, and the UI and data are connected through View Models (WPF Binding), and View Models
- either passed to the methods of the presentation interfaces from the presenters
- or instantiated by the views themselves
The main functionality is covered with tests (nUnit and Moq are used).
Problems
Surely in the application there are still undetected bugs.
In addition, I am not a great specialist in drawing icons, so the system tray icon on a white background looks angular, as if without anti-aliasing; in all other cases, the icons look, for me, at least, acceptable (but I will not refuse any help or advice).
When you first start for a while, all folders will be searched on the user's computer, so you have to wait a few minutes.
If the Navigation Assistant was not closed when the computer was last shut down, or it was not automatically started at system startup, then it is impossible to tell if the current directory cache is up to date; therefore, this cache will be updated in the additional stream, and until the completion of this process, the last saved directory cache will be used (which may not fully correspond to the current file system).
Yes, .Net in general and WPF are slow and resource-intensive, but this has to be tolerated.
Conclusion
So, I hurried to share with the hardware community a small utility for easy navigation in Windows Explorer and Total Commander. I hope it will be useful to anyone. In addition, it may be useful to have a brief overview of the technical solutions.
Once again, links: to the
installer , to the project on
google code (svn is used, as is most likely known to most).
The source code is open, the application is free, distributed under the MIT license.
Thanks to all!