ShellAnything icon indicating copy to clipboard operation
ShellAnything copied to clipboard

Allow ordering of custom menu entries

Open MESLewis opened this issue 5 years ago • 5 comments

Right now all ShellAnything menu entries are inserted near the middle of the context menu. I'm interested in heavy configuration of the menu and I would like to be able to add options near the top(ex "Edit" or "Open with Notepad++") and bottom(ex Properties) as well.

From my research I believe this may not be a straight forward change.

MESLewis avatar Feb 14 '20 16:02 MESLewis

Hi.

This looks like a good idea. However, could you clarify your point because I do not exactly understand what you are proposing. The order in which each menu appears in a context menu is defined by the order in the xml file. If you want a menu to be inserted before another, you can define a <menu> node before the other.

For example, the following menus

    <menu name="test">
    </menu>
    <menu name="foo">
    </menu>
    <menu name="bar">
    </menu>

will be inserted in the context menu in the exact same order: image

end2endzone avatar Feb 15 '20 13:02 end2endzone

Maybe you are proposing to order the menus across xml configuration files. Like if file1.xml contains menu1 and file2.xml contains menu2 and you would like to order menu1 before/after menu2. Do I understand your idea?

It does not seems to a complicated task. However, I am currently working on #36 modifying win32Clipboard. to support utf-8 strings.

Would you like to contribute to the project? I am open to push request.

end2endzone avatar Feb 15 '20 13:02 end2endzone

Thank you for the response, apologies for the late reply. I updated the original issue to clarify. Good to know what ordering options there are in the mean time.

I'm looking to do some in depth customization of menu options, I'll definitely take a look at the code and see where I can help

MESLewis avatar Feb 18 '20 18:02 MESLewis

Apologies for the late reply. That could be possible.

A shell extension like ShellAnything is a plugin for Windows File Explore. File Explorer is providing a pre-build menu (HMENU) when calling CContextMenu::QueryContextMenu().

Manipulating this menu can be tedious and can result in system instabilities. The problem is that menu manipulation could break other shell extensions expectations. More investigation is required on this issue.

end2endzone avatar Dec 16 '23 18:12 end2endzone

Another problem is alignment based on previous menus from other shell extensions.

A possible way to implement this could be by creating after or before attributes for <menu> elements. For example, to insert test menu after the AMD Radeon Settings, one could declare the menus as the following:

<menu name="test" after="AMD Radeon Settings">
</menu>
<menu name="foo">
</menu>
<menu name="bar" before="Git GUI Here">
</menu>

However, this could be problematic. When File Explorer call ShellAnything to render its menus, there is no guaranty that AMD Radeon Settings or Git GUI Here menus are already drawn. The alignment could not work as the user expect it.

end2endzone avatar Dec 16 '23 18:12 end2endzone