Retrieving IDE view data (info) with a keyboard shortcut RRS feed

  • Question

  • Hi there,

    I want to extend the IDE with a custom (small) context sensitive help so I need to add a keyboard shortcut and detect from where that call comes from (what IDE view) and have access to the data inside that view.

    Right now I have an External Tool and keyboard shortcut for that tool and I am using the Commands: and Arguments: fields in the externals tools settings windows to retrieve and pass information to another program I wrote. But it is very limited. I'd like to do something similar (but better) from inside the Properties view detecting on what field (property) the cursor is on and best having access to the data in that view. The same thing for the Toolbox View, Class View etc.

    Can someone point me into the right direction if it can be done.

    Thank you, bye.




    Thursday, January 27, 2011 10:22 PM


  • I don't think this is really possible in full generality.  Command dispatch doesn't carry with it any idea of a 'location' from which something was dispatched as commands can be invoked via the UI (buttons, menu items), via the Command Window, via the 'command line mode' of the standard toolbar find combo, via DTE (programatically), via Macros, programatically via IOleCommandTarget of the shell, etc...

    The shell can expose what window is selected but only to the extent that it can give you an IVsWindowFrame for said window.  The contents of every window of the shell is  black box as far as the shell is concerned and we can't tell you anything about them.  Some offer further extensibility interfaces to interact with their content, others don't (hence the doubt this can be done in full generality).


    • Marked as answer by Victor_Chen Tuesday, February 8, 2011 5:16 AM
    Thursday, January 27, 2011 11:46 PM