Visual Studio addin - override all existing commands?

224 views Asked by At

I had an idea the other day to build a Visual Studio extension on GitHub that will teach people how to use hotkeys. I already have a dump of all hotkeys available (thanks to Mads Kristensen and his ShortcutExplorter project).

The way it will work (if possible) is to go through every command there is in Visual Studio, and override that command myself. Then, when you invoke it, it will run run the original command, but pop up with a semi-transparent dialog saying what hotkey to use instead.

For instance, if pressing the "Comment" button to comment out lines in Visual Studio, it will do the commenting, and pop up with a dialog saying "This action can be invoked via CTRL + K, C instead".

So. Is it possible for me to override existing commands in Visual Studio somehow or the context menus?

2

There are 2 answers

0
Mathias Lykkegaard Lorenzen On BEST ANSWER

Here's the extension I ended up making.

https://visualstudiogallery.msdn.microsoft.com/7c2c329e-331d-4b5c-b59a-7c4e7f8548de

Here are the source codes for the solution.

https://github.com/ffMathy/shortcut-commander

1
BLoB On

Not sure if every event is available but a lot are available using the EnvDTE namespace.

e.g. (in VB but) FindEvents interface (Provides events for Find-in-Files operations.) ...

<System.ContextStaticAttribute()> Public WithEvents FindEvents As EnvDTE.FindEvents

Public Sub FindEvents_FindDone(ByVal Result As EnvDTE.vsFindResult, ByVal Cancelled As Boolean)     Handles FindEvents.FindDone
   MsgBox("test")
End Sub