Files: Windows Explorer context menu

Created on 17 Jul 2019  路  31Comments  路  Source: files-community/Files

I would like to be able to use Windows Explorer's context menu in Files, especially its custom entries, like, in my case : WinRAR, 7-Zip, LockHunter, Beyond Compare, Git Bash, Sublime Text, etc...

The context menu is also stored in Windows Registry.

I found some of my context menu items on my Windows Registry database, but, they're not located in the same place.

There's at least these :

HKEY_CLASSES_ROOT\*\shell
HKEY_CLASSES_ROOT\*\shellex
HKEY_CLASSES_ROOT\Folder\shell
HKEY_CLASSES_ROOT\Folder\shellex
HKEY_CLASSES_ROOT\Directory\shell
HKEY_CLASSES_ROOT\Directory\shellex

(Source)

Some way, CCleaner and other software manages to find them all.

Two software that I use, TreeSize and WinSCP, allows to display Windows Explorer's context menu, TreeSize isn't open source but WinSCP is : I found the feature in this Delphi file by the ShellDisplayContextMenu function.

I think this approach is different from reading the Registry because it's the genuine Windows Explorer context menu which is shown, so I guess there's some way to access it directly.

Unfortunately, I there's nothing more I can do to help you figure this out.

Good luck

Implemented enhancement

All 31 comments

Nothing is impossible, especially when other developers have done it before...

And the commands are specified in the Registry

2019-07-18 12_00_05-

@KaKi87 @yaichenbaum Actually it is impossible because, to my knowledge, universal apps do not have access to the registry.

However, we could investigate reading registry values from another Win32 component. e.g. one similar to ExecutableLauncher

UWP apps can actually read from the registry, however I am not sure how something like this would work with localization.

Context menu strings are exclusively managed by the software which added itself to it. Indeed, if you change Files's language, the software's won't.

There are two types of context menu entries that I can think of, the first type would be for the open with menu and the new file menu, the second type would be for additional entries in the right click context menu for items such as 7zip.
We would probably need a way of classifying them and adding sub menus for the ones that require them like 7zip.

I would like to take a look at this. However what I couldn't find is the menu options for 7-Zip. Where is the submenu items located under the registry of Windows for 7-Zip?

Here is more information about how to create and retrieve shell context menus information from the registry.

https://stackoverflow.com/questions/20449316/how-add-context-menu-item-to-windows-explorer-for-folders

https://www.askvg.com/add-cascading-menus-for-your-favorite-programs-in-windows-7-desktop-context-menu/

The open with menu items are interesting because it includes more then the programs you would expect to show. For example, the items for text files include a bunch of strings that seem to have nothing to do with opening files.
image

Some of the application's shell context menu cannot simply be retrieved from the registry. 7-Zip for example is using shell extensions. These are in-process COM objects which extend the abilities of Windows operating system. To retrieve the menu items for 7-Zip, COM object needs to be queried.

@BuraChuhadar We can technically check for 7zip and manually add the menu items like we do for QuickLook.

I am not sure how did you get the "Open With" list from your registry. I am seeing on my end Open With is also a shell extension which needs to be queried as a COM object. See "ComputerHKEY_CLASSES_ROOT*shellexContextMenuHandlersOpen With" which then calls "%SystemRoot%system32shell32.dll".

I got the list from this key Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.

I would suggest to keep it simple and look only these sections for now without shell extension functionality:
HKEY_CLASSES_ROOT\*\shell HKEY_CLASSES_ROOT\*\shellex HKEY_CLASSES_ROOT\Folder\shell HKEY_CLASSES_ROOT\Folder\shellex HKEY_CLASSES_ROOT\Directory\shell HKEY_CLASSES_ROOT\Directory\shellex

Then it can be expanded into "Open With" and/or shell extensions functionality.

@BuraChuhadar That sounds like a good starting point, is this something you wanted to implement?

Yes I want to start implementing the first phase please.

@BuraChuhadar Make sure to keep us updated on your progress 馃槉

So far I have this: https://github.com/duke7553/files-uwp/commit/4ee24dbb73956762910aa8b86e9baef9d522db4f

I have been experimenting with also getting the information from other ways.

Current progress: https://github.com/duke7553/files-uwp/pull/699 not done yet.

Would it also help the support for other shell extensions? Like TC4Shell which is an archive viewer integrated into File Explorer.

I think an approach like Windows Terminal will be better. A single json file will store the context menu data for different file extensions in different profiles, user can edit this file to add/remove/sort the entries of context menu for a certain item. Additionally, we can provide a gui for editing context menu which may contain detected entries from registry as suggestions.

As long as there's a GUI, it's okay.

I think an approach like Windows Terminal will be better. A single json file will store the context menu data for different file extensions in different profiles, user can edit this file to add/remove/sort the entries of context menu for a certain item. Additionally, we can provide a gui for editing context menu which may contain detected entries from registry as suggestions.

Most users are not interested in setting up the right click context menu.

Well, my initial feature request was to add an entry to the UWP context menu which would contain the existing entries of the Windows Explorer context menu, just like TreeSize, WinSCP, Beyond Compare, etc.
So, if that feature gets implemented, then, technically, the context menu would be customizable using existing software with Windows Explorer context menu customization features like CCleaner or ShellMenuView.
Thanks

@BuraChuhadar Can you share a status update where things are with this issue? Thank you 馃槂

@gave92 Thank you for all your great work on implementing this feature in #1754.

Nice ! When will the feature be available on MS Store ?

Nice ! When will the feature be available on MS Store ?

The feature is already available to users in the beta flight, however it will be a at least couple weeks before we roll it out to regular users since we still working on refining the improved context menu.

Is there any way to get into beta flight?

I have Files UWP - Preview, version 0.13.1.0, is that the beta flight ? It doesn't seem so, because I can't see find the feature

hello everyone, I apologize for the radio silence I have been dealing with some life/work issues and couldn't get to this work. I really appreciate @gave92 for implementing this feature this looks really nice.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbvc97 picture jbvc97  路  3Comments

Francisco820 picture Francisco820  路  3Comments

generalguy41 picture generalguy41  路  3Comments

eraychumak picture eraychumak  路  3Comments

SinGuLaRiTy2001 picture SinGuLaRiTy2001  路  3Comments