CMDUSED_SECTION and shared commands

By default in the IDE, F8 is bound to the command Edit.GotoNextLocation (guidVSStd97:cmdidNextLocation).  This command works in the both the Output and Find Results windows.

I would like my tool window to respond to Edit.GotoNextLocation. 

Is this just a matter of setting up my ctc file correctly or does the toolwindow also need to implement a particular interface (other than IVsWindowPane and IOleCommandTarget)



Answer this question

CMDUSED_SECTION and shared commands

  • Wong Junn Kit

    hmm - looks like I might need to do something with selection and use SEID_ResultList somehow, maybe

  • Dd365

    Thanks Aaron - I had been using the VSIP documentation, so I've updated to the lasted VSSDK.

    [The CMDUSED_SECTION documentation uses incorrect syntax - at least as far as my ctc compiler is concerned (I believe I'm using the RTM bits).  Each command should be terminated with a semicolon.]

    The new documentation states:
    "When any of the windows of the current VSPackage has focus, and a user selects a Cut, Copy, and Paste command, the current VSPackage, and not the IDE﹐ handles these operations."

    That's close but not the whole of what I would like to accomplish.  I am able to successfully handle Edit.GotoNextLocation if my toolwindow has focus.
    But I want a chance to handle it if my toolwindow is present while the user focus is in the source editor provided by another package (like the default C++ editor).

    This already occurs for some default items: you can be in the standard C++ editor and press F8 (assume default VS keybindings).  If the Build Output pane is present, you are taken to the next build error.  If the Find In Files Results window is above the Build Output pane, then F8 will take you to the next find result (opening a new document if required).  I believe this shows two different implementations of Edit.GotoNextLocation that are both available when the editor itself has focus.

    What else is necessary to play like that

    Thanks


  • Chellam

    ah - I need to use IVsTrackSelectionEx to call OnElementValueChange passing in SEID_ResultList upon tool window creation.

  • rhenders

    Yep that was it Sean. I was just preparing a post, but I see you've figured it out.

    Regards,
    Aaron Marten



  • Tamiri

    Hi Sean,

    You should only need to add an entry to the CMDS_USED section as you describe in your first post. Check out the topic in the VSSDK help. You will need to do something very similar to what is demontrated with the Cut/Copy/Paste commands. You will be able to handle the command invocation in your IOleCommandTarget implementation:

    ms-help://MS.VSIPCC.v80/MS.VSSDK.v80/dv_vsintegration/html/cd5cc5ee-0f66-4492-af0a-60f1b651c7f4.htm

    Hope that helps! Please reply if you are having troubles getting this to work properly.

    Thanks,
    Aaron Marten
    http://blogs.msdn.com/aaronmar



  • CMDUSED_SECTION and shared commands