views:

125

answers:

2

While editing a file I want to use a hotkey to call an External Tool that I have setup to use the "Output" tab. Currently when I use the hotkey the focus leaves the edit pane and goes to the "Output" window - I want the focus to not change from the edit pane.

A: 

Try assigning a macro to your hotkey and executing the external tool from the macro. You can create a new macro using the Macro Editor by pressing Alt-F11.

Stephen Nutt
Unfortunately using a macro to call the external tool still switches focus to the "Output" tab. Thanks for making me aware of Visual Studio macros though.
Brandon Leiran
A: 

Using a Visual Studio macro (inspiration from Stephen Nutt) an acceptable (to me) workaround is:

Public Module RunTestExternalTool
    Sub RunExternalTool1andReturnFocusToEdit()
        DTE.ExecuteCommand("Tools.ExternalCommand1")
        DTE.ExecuteCommand("View.ViewCode")
    End Sub
End Module

This makes an assumption that the user wants to return focus the the ViewCode pane (no matter where they started).

Brandon Leiran