Windows 7 Cascading Menus

Discussion in 'other software & services' started by m00nbl00d, Dec 12, 2011.

Thread Status:
Not open for further replies.
  1. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    I'm trying to create cascading menus in the desktop.

    I followed this example http://msdn.microsoft.com/en-us/library/windows/desktop/hh127431(v=VS.85).aspx#cascading_extended

    That's for files only, though. But, I decided to give it a try. :D It didn't work out. It either works, but that's not exactly how it's done; or, it doesn't work, at all.

    So, what I'm trying to do is when right-click an empty place on the desktop or inside a folder, I get something like:

    SomeEntryHere* > AnotherEntryHere1 > Shortcut for program1
    SomeEntryHere* > AnotherEntryHere2 > Shortcut for program2
    etc

    * it's the same one.

    Do you folks know how to do it, if it's even possible for context menu shortcuts? Unfortunately the first example at that page has no explanation. If it had, I could possibly try to make something work... lol


    Thanks
     
  2. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Umm, I thought I posted that somewhere o_O

    If not, and you still need help, I have done this in win7. I think I remember where I put the data for it, but need some sleep. Will check back tommorrow and see how you fared.

    I am almost positive I shared that with you though.

    Sul.
     
  3. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    And, I also got that same vague idea... I just don't remember where I saved anything I might had about it. :D

    I actually do remember playing with this stuff quite some time ago in VM, when I still had my other laptop. :( lol I think I had it working (back then), but I decided to follow another route:

    I simply added EntryHere1 > Shortcut for program1, etc. Now, I realize I made a mistake and that the context menu is getting over crowded. lol
     
  4. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    This is how I have been making cascading context menus.

    First, you must choose the class for which to apply the context menu. If you want a menu (with submenus) to work with text files, then you would use the class .txt. I show it being used with a the directory class.

    * Note - the desktop and other special folders are different, so don't expect to be able to use this on just anything you want.

    Here is an example, with remarks for your pleasure ;)

    Code:
    Windows Registry Editor Version 5.00
    
    ; first create the main menu key in your chosen class - this key name is displayed!
    ; give it no subcommands
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest]
    "Subcommands"=""
    
    ; next, under the main menu key, create a sub-key. Use MUIVerb for the display name
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout1]
    "SubCommands"=""
    "MUIVerb"="flyout 1"
    
    ; if you stop at the first sub-key, it is an item to click on.
    ; to get it to become another menu with items within, you must repeat the process
    ; of creating another sub-key, like this
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout1\Shell\subfly1]
    "MUIVerb"="subfly1 item"
    
    ; when you are ready for the item to take some action, you must use the command key
    ; and assigne a default value (@ = default)
    ; just put in some command, like an exe. You can also add command line parameters to exe's
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout1\Shell\subfly1\command]
    @="notepad.exe"
    
    ; here we create a second item under the main key, which will be a second sub-key
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2]
    "MUIVerb"="flyout 2"
    "SubCommands"=""
    
    ; and again, we start by repeating the sequence, with this entry being
    ; another menu that will cascade out
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2\Shell\flyout2b]
    "MUIVerb"="flyout2b"
    "SubCommands"=""
    
    ; making this be the final item
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2\Shell\flyout2b\Shell\Flyout2b item]
    "MUIVerb"="flyout 2b program 1"
    
    ; and finally the command to give
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2\Shell\flyout2b\Shell\Flyout2b item\command]
    @="calc.exe"
    
    
    ; now we will use a different method for commands
    ; we start by creating another item to use on the flyout2 cascading menu
    ; notice we don't create the "command" reg key though
    ; and that we now utilize that "SubCommands" value
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2\Shell\flyout2b\Shell\Flyout2b item2]
    "MUIVerb"="flyout 2b item program 2"
    "SubCommands"="Flyout.ntpd"
    
    ; a command store entry is just a command that is stored
    ; but that can be easily referenced
    ; it is created in this registry key, like this
    
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\Flyout.ntpd]
    @="Start Notepad"
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\Flyout.ntpd\command]
    @="notepad.exe"
    
    ; it should be noted that you must use double backslashes when using
    ; a fully qualified path, like this - a single will not work
    ;@="c:\\windows\\notepad.exe"
    
    ; further, you could create a menu item that passes more than one stored command, like this
    ; also note that since the "SubCommands" value has more than 1 entry,
    ; the values are "auto created", one for each stored command.
    ; the title of each entry is taken from its default value (ie. @=Start Notepad)
    [HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout2\Shell\flyout2b\Shell\Flyout2b item3]
    "MUIVerb"="multi example"
    "SubCommands"="Flyout.ntpd;Flyout.calc"
    
    ; and we must have those stored commands to use them, like this
    
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\Flyout.calc]
    @="Start calc"
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\Flyout.calc\command]
    @="c:\\windows\\system32\\calc.exe"
    
    ; also note how you would pass a variable to the command
    ; the variable in this case would be the name of the file/folder
    ; the context menu iniated on
    ; in this case, it would use notepad to open the object you right clicked on
    ;@="c:\\windows\\notepad.exe \"%1\""
    That is more infos than I found in one place when I learned how to do it. The MS help files I found were quite lacking IMO.

    Sul.
     
  5. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    I saved the info and will be looking at it later. :thumb:

    But, by looking what you provide, I think this is the step ([HKEY_CLASSES_ROOT\Directory\shell\CascadeTest\Shell\flyout1\Shell\subfly1]) where I screwed up. :oops: :D

    I really need to start writing notes for this "insignificant" matters. :isay:
     
  6. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    OK...

    I created something good looking. :D And, where I screwed up before had actually to do with the paths. I had replaced C:\\Program Files\\ with %ProgramFiles%. While this works with Icons, it won't work for Paths. :ouch:

    I also came to realize there's a limitation in the number of sub-menus and keys.

    As an example:

    Menu1 - Menu2 - Menu3: command1, command2, command3, command4
    Menu1 - Menu2 - command5
    Menu1 - Menu2 - Menu4: command6, command7, command8, command9
    Menu1 - Menu2 - command10
    Menu1 - Menu2 - command11 - No can't do!

    I need to test if the limitation occurs from Menu2 onward, once it reaches command10. I need to see if it still allows me to add Menu1 - Menu5 - command11 and so on.

    Tough luck. If it doesn't work, I'll have to redistribute it in another cascading menu. I just hope it's not a full limitation.

    -edit-

    It's a limitation. There's a limit number to what can be added.
     
    Last edited: Dec 16, 2011
  7. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    While not a native solution, you might give FastExplorer a try. That is a solution I would use in place of the more complex shell extension, which is likely the ideal solution but requires quite a bit of learning.

    Sul.
     
  8. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    I had downloaded a few tools that allow to work with the shell extensions, but I haven't tried them yet. I wasn't familiar with the one you mentioned. I'l download it and give it a try.

    But, I'll be giving it a new try and will go in a different direction. I'll try and reduce the cascading menu a bit, and will use individual menus and see what happens. It would be nice to have it all within a given group and sub-group, though.

    Oh, well, we can't always have things as we please. :argh:
     
  9. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    An interesting behavior that I found and wasn't aware of is that using this cascading menu method, one needs to be cautious if we want things to appear in the order we created them, using the values in "MUIVerb", such as "MUIVerb"="Open HitmanPro", "MUIVerb"="Default Scan", etc.

    Example:

    [HKEY_CLASSES_ROOT\DesktopBackground\shell\Antimalware\Shell\HMPro\Shell\HMPro-Open]

    [HKEY_CLASSES_ROOT\DesktopBackground\shell\Antimalware\Shell\HMPro\Shell\HMPro-EWS]

    In this example, unlike CommandStore, the commands will be added in alphabetical order to the cascading menus, by reading HMPro-Open, etc. They won't stay as we created them. Considering that HMPro-EWS in alphabetically lower than HMPro-Open, then HMPro-EWS will appear first. If we want it to appear respecting the "MUIVerb" entries, then we must make sure that HMPro-EWS becomes something like HMPro-QEWS.

    If we do it using CommandStore, then everything stays has we created. Adding to CommandStore commands appear in the order we add them; if we add them to using the first method, then it works in alphabetic order. Were you familiar with this behavior?

    -edit-

    It appears that using CommandStore is a bit more efficient and won't force us to add random characters to have things as we want them. o_O
     
    Last edited: Dec 17, 2011
  10. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    I think I was previously wrong (post #6).

    I messed a little bit more with the cascading menus yesterday, and apparently we can have up to 12 commands within a cascading menu. Most likely I had done something wrong before.

    I added 12 commands like this:

    Menu > Submenu 1 > cmd1, cmd2, cmd3, cmd4
    Menu > Submenu 2 > cmd5, cmd6, cmd7, cmd8
    Menu > Submenu 3 > cmd9, cmd10, cmd11, cmd12

    If I add cmd13 to Submenu 3, it won't work. If I add a new command to any of the other Submenus (1 and 2), then cmd12 won't work either, considering it's the last command in the chosen order.

    It's really unfortunate that this limitation exists. Without recurring to 3rd party applications, the only alternative is to add another Menu to the context menu.

    I think I've read about a limitation in this aspect yesterday, as well. I don't recall where I've read it, but I remember someone mentioning that we can only have up to 3 extended cascading menus.

    I'll have to check whether or not it's accurate, or if that person simply made a mistake.
     
  11. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Not sure about this, but I think I recall seeing mention a long time ago about a limit to context menu related items due to the fact that it is a context menu, without (at that time) the ability to "scroll", so in essence the context menu should only ever be so big because of space limitations.

    Don't know if that is a legacy parameter that carries over today or not.

    I have not needed to build such large menus, so I did not run into the limitation when I have built cascading menus.

    Sul.
     
  12. m00nbl00d

    m00nbl00d Registered Member

    Joined:
    Jan 4, 2009
    Posts:
    6,623
    For those using Windows 7, I've found an application - Jumplist Launcher - that will allow us to create jumplists in the task bar. It's a pretty simple application, actually. We don't have to run it in real time; once we set everything up, we can close it. We just get an icon in the task bar where we get the jumplists. We can create groups of jumplists.

    We can add a total of 60 items.

    It's a great way of not having icons in the Desktop and also a nice way of not having a too crowded context menu.

    Official website: en. www. ali.dj/jumplist-launcher (Remove the spaces).

    A review: -http://www.addictivetips.com/windows-tips/jumplist-launcher-how-to-create-custom-jump-list-in-windows-7/

    There's another open source application - Jumplist Extender, which I still haven't tried. I believe this one only allows to add jumplists to individual applications.

    -https://code.google.com/p/jumplist-extender/
     
    Last edited: Jan 4, 2012
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.