locked
How to place my menu at the specified location? RRS feed

  • Question

  •  

    Hi,

    Please tell me how to place my menu at the specified location? Specifically, I want to place the my menu below.

     

    Help

    - View Help

    - My Menu                ←   Add here

    - Manage Help Settings

    -------------------------------

    - MSDN Forums

     

    What should I write anything in the .vsct file.

     

    Friday, October 22, 2010 5:01 AM

Answers

  • Hi I.TMK,

    Thanks for your post.

     

    As far as I know, there is not a good way to do that to my knowledge. 

     

    The best way I could recommend would be to use something like VSCTPowerToy to look at the command table of VS, specifically to look at the Help menu and the groups/items within it.

    The group he needs to add to  VSCT is

     

    GUID = "{4a79114b-19e4-11d3-b86b-00c04f79f802}"

    ID = "0x0010"

     

    which has the 'nice' VSCT symbols of

     

    GUID = guidHelpGrpId

    ID = IDG_HELP_GRP

     

    To get the proper priority to be such that it falls between the two items you wants to be between, this is where it runs into the real problem :( 

    The priorities of the two commands are the same, which is sloppy command authoring since it means there is no deterministic way to insert a command between them.

     

    View Help:  (Priority = 0x0100)

    Manage Help Settings: (Priority = 0x0100)

     

    On the other hand, you can make it manually by Tools->Customize,

    in the dialog box, switch to Commands Tab, in the Menu bar dropdown list, select "Help" in the very button.

    If your custom menu is already under "Help", just move it up or down with button on the right.

     

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Marked as answer by I.TMK Wednesday, October 27, 2010 1:16 AM
    Tuesday, October 26, 2010 2:31 AM

All replies

  • Hi I.TMK,

    Thanks for your post.

     

    As far as I know, there is not a good way to do that to my knowledge. 

     

    The best way I could recommend would be to use something like VSCTPowerToy to look at the command table of VS, specifically to look at the Help menu and the groups/items within it.

    The group he needs to add to  VSCT is

     

    GUID = "{4a79114b-19e4-11d3-b86b-00c04f79f802}"

    ID = "0x0010"

     

    which has the 'nice' VSCT symbols of

     

    GUID = guidHelpGrpId

    ID = IDG_HELP_GRP

     

    To get the proper priority to be such that it falls between the two items you wants to be between, this is where it runs into the real problem :( 

    The priorities of the two commands are the same, which is sloppy command authoring since it means there is no deterministic way to insert a command between them.

     

    View Help:  (Priority = 0x0100)

    Manage Help Settings: (Priority = 0x0100)

     

    On the other hand, you can make it manually by Tools->Customize,

    in the dialog box, switch to Commands Tab, in the Menu bar dropdown list, select "Help" in the very button.

    If your custom menu is already under "Help", just move it up or down with button on the right.

     

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Marked as answer by I.TMK Wednesday, October 27, 2010 1:16 AM
    Tuesday, October 26, 2010 2:31 AM
  • Even that won't guarantee anything, the customize dialog will try to place it in the right place, but it too is based on priorities and it will not be able to generate one between those two items.  It may be the case that it ends up in the right spot (it always will initially, the test is can you shutdown VS, restart and have it be in the same spot), and that may change if anyone else makes modifications to that same menu.

    In short since there is no priority gap in between the items there is no way to guarantee the placement he wants, even if you find something that appears to work it could stop working next release (since we only guarantee stable ordering based on priorities and have NO guarantee about ordering amongst items with the same priority).  We probably wouldn't change anything that would cause it to change in the next release, but the ordering when priorities are all the same is an implementation detail and not something you can rely on.

    Ryan

    Tuesday, October 26, 2010 3:06 AM