My Development Blog

My Development experiences

Posts Tagged ‘Tools’

Visual Studio – File Navigation Extension

Posted by ipwright83 on May 30, 2012

One of the most frustrating things I found when I upgraded to Visual Studio 2010 was the navigation. I work with a fairly large solution with hundreds of files, many of which I can’t locate via the solution explorer as I just can’t remember where they are. To make this harder, sometimes the file names don’t match the class names and other times the name is the compound of several words that I can’t quite remember the combination of.

Within Visual Studio 2008 I used to use Resharper, and I almost exclusively used this for the file searching capabilties. It was quick and supported camel case searching. I’d previously used other solutions but found them to be slower and not as lightweight. Once I upgraded to VS2010 however I found that the search had been disabled in the express version.

Not wanting to sacrifice the brilliant searching I decided to write my own Visual Studio addin (I found this much harder than I anticipated, hence the extension doesn’t get many updates). It does exactly what I wanted, in a performant way and is avaliable to anyone who wants it. It allows searching by name or camel case and supports wildcards, with filtering as you type and highlighting of the matching criteria, bumping the best matches to the top of the list.


You can find the shortcut under the ‘Edit->Find and Replace->VS File Nav’ option and can re-bind the shortcut using Edit.VSFileNav.

Feel free to have a play and leave some feedback.

Visual Studio Gallery – VSFileNav


Posted in Uncategorized | Tagged: , , | Leave a Comment »

Reflector context menu in Windows Explorer

Posted by ipwright83 on May 1, 2012

I often find myself using Reflector to open up DLL’s, sometimes to double check they contain the code I think they do (match the expected build version) or othertimes just to browse other assemblies. However I always find myself jumping to my desktop to find the shortcut and dragging my DLL on. I wondered to myself why I was doing this today when I can easily just extended the Explorer shell.


Unfortunately in their bid to make Windows easier to use for the majority, they make it more difficult for the power users. The ‘File Types’ section that used to be avalaiable via the Tools menu in Windows Explorer has gone. This was actually just a handy way of modifying the registry. A quick bit of googling led me to the correct set of keys to add a custom context menu.

Windows Registry Editor Version 5.00

@=”Reflector.exe %1″


Placing the above in a .reg file and running it, or adding the keys manually and setting the default value will add a ‘Reflect’ option to your .dll context menu and make things that little bit easier. Happy reflecting.


[Reflect] can be modified to change the title of the context menu item.
[Reflector.exe] needs to be modified to point to the actual location of Reflector.

Posted in Uncategorized | Tagged: , | Leave a Comment »

Multiple Input Devices – Controlling the accelerator pedal

Posted by ipwright83 on April 27, 2012

My work machine has a couple of input devices, mainly to try and reduce the onset of RSI. I’ve got an EM500 Ergonomic Computer Mouse and a Logitech MX600 Laser Mouse


The Ergonomic mouse by the way is brilliant and really helps prevent RSI ensuring that you’re wrist is better supported and more naturally placed. There was one significant problem with it however, the sensitivity was much less than my MX600. This meant if ever myself or a fellow developer wanted to use the MX600 on my machine there was a speed conflict. Either the MX600 had the speed of a Ferrari and you had to be very careful not to twitch the accelerator pedal too much, or the EM500 had the speed of a tortoise.

Changing the speed of the mice in control panel quickly became a hassle, so I had a quick look around to see if there were any applications that would automatically switch it based on the device. I found one but unfortunately it cost $15 and therefore would have been a lot of hassle getting it ordered. I figured it surely can’t be that hard to write my own can it?


I started off by looking for libraries – it’s always better reusing existing code than writing something from scratch. I quickly came across RawInputSharp which is a port of a C++ library for monitoring mouse input. I had an attempt at getting the demo’s in the library working, the compiled version worked fine, but whenever I tried to built it from source it just wouldn’t work. I left it alone and came back to it a few weeks later and discovered the problem was due to the build configuration (the target platform if I remember off the top of my head). I got it all working and was then able to register for mouse events.

public void MouseSpeedSwitch(){
   // Register for the mice
   this.mouseInput = new RawMouseInput();

A little special handling later to fire the necessary updates:

/// Handle the Mouse Move Events and Update the Mouse Speed 
protected const int WM_INPUT = 0x00FF; 
protected override void WndProc(ref Message m) 
   switch (m.Msg) 
      case WM_INPUT: // Read in new mouse values. 
         if (this.mouseInput != null) 
    base.WndProc(ref m); 

At this point I had mouse events and the ID’s of the devices every time I moved a mouse within my application. I made a minor change to the original library which suddenly switched the application to detecting mouse events globally in the operating system, regardless of whether the mouse was in my application or not. Brilliant!

public void RegisterForWM_INPUT(IntPtr hwndTarget) 
   rid.usUsagePage = 0x01;
   rid.usUsage = 0x02; //mouse
   rid.dwFlags = 0x00000100; // Register for events outside the current window

Things were starting to look good at this point. A few simple methods later to retrieve the names of mice from the registry and update the mouse speed and the application was almost complete. I then wrote a little very simple UI so I could use my application:

Once added into the Startup folder in the start menu, I no longer needed to worry about changing the speed of my mouse. Everything would be done automatically 🙂

Feel free to download the application, it’s free to use for both personal and commercial use – currently hosted here.

Posted in C#, Events, Mouse, Tools | Tagged: , , | Leave a Comment »