Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Enhancement]: Give option to revert to classic context menu too #6

Closed
Gaurav-Original-ClassicShellTester opened this issue Aug 30, 2021 · 8 comments
Labels
enhancement New feature or request fixed

Comments

@Gaurav-Original-ClassicShellTester
Copy link

Gaurav-Original-ClassicShellTester commented Aug 30, 2021

Perhaps some users will prefer the modern context menu but I just can't get used to it. I use too many shell extensions and Registry verbs which will never be updated for new style of context menus.

So please if you can bring them back, it will be another delightful surprise.

This Registry tweak stopped working in recent builds: https://winaero.com/how-to-enable-full-context-menus-in-windows-11/

@valinet
Copy link
Owner

valinet commented Aug 30, 2021

Yeah, I know about the registry tweak, unfortunately. I kind of use quite a few shell extensions too, now I realize since I do not have that quick of an access to them anymore... the only thing I like about the new menu is that it indeed is way less cluttered out of the box, as there are a TON of things in the old menu that I don't have a use for...

With that being said, yeah, I am looking into it at the moment, I wish I could achieve both of these:

  1. Being able to show the old context menus at all times, as you said
  2. Also, keep some filtered items from the original menu in the new menu; this way, I could tolerate the new menus more easily if they had my 7zip commands in there, plus "Search with Everything", plus "Edit with Notepad++", but without all the other unnecessary stuff from the original menu. Plus, the new menu looks nicer indeed, and they seemed to have tweaked it up a bit so it has better response time and no lag compared to what shipped with the first build that had it.

@Gaurav-Original-ClassicShellTester

Maybe Microsoft will have a group policy after enterprises demand the full context menu. There's no way everyone's gonna settle for this oversimplified menu even if it looks pretty.

@valinet
Copy link
Owner

valinet commented Aug 30, 2021

Maybe and hopefully, but I think the chances are pretty low... if they wanted, they could have left the option you mentioned in place... anyway...

If you want, you can take a look yourself on the system files as well, maybe you figure something out. It's easy, just take the DLL/EXE, make a copy of it in some folder, open it in IDA Freeware 7.6, let it download symbols, disassemble and do the initial auto analysis, and then you have a functions list at the left, plus assembly in the middle. Double clicking an item gets you there. Press F5 and C-like pseudocode will be generated from the assembly, it helps you visualize it easier.

Regarding system files, some stuff that I know at the moment:

  • twinui.dll - what I used from it is a function that listens for certain hotkeys, I had to hook that and show the Win+X menu through that because it did not work directly from the function where the hotkey is actually captured
  • twinui.pcshell.dll - contains the code for Win+X menu
  • explorer.exe - there I hooked a method that listened for hotkeys as well, which is actually what captures the Win+X combination in the first place
  • stobject.dll - this contains stuff related to some items in the tray, including the "Safe to Remove Hardware" icon; that's where I hooked the WndProc of the window that creates these icon in order to prepare for skinning that menu
  • ExplorerFrame.dll - this contains the context menu we are looking for, among other things, at least it contains for the tree view at the left of the Explorer window, probably for the main area as well, I haven't checked yet

@valinet
Copy link
Owner

valinet commented Aug 30, 2021

@Gaurav-Original-ClassicShellTester I have implemented this, now classic context menus are shown instead of the clunky new ones. The necessary modification had to be done in Windows.UI.FileExplorer.dll, but, fortunately, it was easy to patch once you find out about it. There is an if check that verifies some member of the struct (class) ContextMenuPresenter and if that member is set,DoContextMenuHelper will show the new immersive menu. If not, FallbackToClassicMenu (name is self explanatory) will provide the default behavior, which can still be found natively in Control Panel originated explorer views (explorer.exe with command line C:\WINDOWS\explorer.exe /factory,{5BD95610-9434-43C2-886C-57852CC8A120} -Embedding).

For anyone that might be interested, to disable changing to the old menus, add this to the settings.ini file:

[General]
AllowImmersiveContextMenus=1

Indeed, the old menus are much better, much quicker and less glitchy to open, plus, the muscle memory is huge, after working a hundred years with them, nothing beats being accustomed to something. Realistically, they should offer a fing option, like, the code is already allowing for the old code path which still has to be supported in legacy views, so why not...?

@Gaurav-Original-ClassicShellTester
Copy link
Author

Gaurav-Original-ClassicShellTester commented Aug 30, 2021

Amazing job again. You are one talented developer! It's because of great projects like this as I don't feel massive disappointment using Microsoft's latest. When I first used the Taskbar, I was depressed. The rest of the Windows teams enhance the OS while the UI team massively cripples it. Has been a problematic trend for a while with oversimplifying the UI.

The USB Safely Remove menu beautification also is great. 👍🏼 Thank you so much!!

Even the Widgets work with Win+W despite the classic Taskbar!

@valinet
Copy link
Owner

valinet commented Aug 30, 2021

Fantastic, it is great to hear! I have the same feeling, they sometimes waste time with useless stuff instead of concentrating on things requested by power users. The thing is, even regular users appreciate power functionality, because if done right, it helps enhance the productivity.

Anyway, I digress. I am glad that you like it. I felt that the USB menu pretty much begged for a skin, it was the only one in the system icons from the taskbar that was left not skinned. I wonder why, if one can do it relatively easily without the source code, why is it so hard to bother a bit updating that last remaining bit of UI...?

Widgets work? That's great to hear! I don't have them installed, so I can't test, but I am glad that they work. The thing is, everything should work, as this patcher only changes the execution flow regarding which taskbar is to be created, whereas UndockingDisabled pretty much disables most of the new stuff and you are even left with brokwn semi functional old UI. I don't understand, for example, why they took out the legacy Win+X menu. They simply put a return 0 in the function body and that was it. maybe it interfered with the new menu, but surely they could have provided 2 code paths like with the context menus. The COM interface that is registered and which can be used to invoke it programatically (every app like OpenShell, StartIsBack++, Start10 etc that has an option "Show Win+X when right clicking Start" use this) is also left unchanged so it points to the new empty function with only return 0, so not even Start menu replacements can invoke the menu anymore. At least not using the traditional COM interface, maybe they provide a new one for the new menu that opens in the new taskbar?

Speaking of Win+X, imo it sucks in the new taskbar, as it should be in the corner, so it is fast to reach it, even when you have the centered icons.

Anyway, enjoy the app. I took your suggestion into consideration (not that I like it that much anyway) and I am currently looking into implementing the DLL inject in a different way that should be much more straightforward and reliable (for example, now, if another Explorer instance opens it does not get injected so the context menus are not reverted to the classic ones, which becomes confusing). So yeah, stay tuned!

P.S. Also, speaking about widgets, maybe we can do an app that has the widgets icon and when launched it opens the widgets panel, that way you can pin it to taskbar and it will launch the panel and mimick the new taskbar's functionality. Or in a distant future, implement a new button in the taskbar shell, besides search and task view. Or instead of the Cortana button. Yeah, personally, I probably won't bother with that, but it'd be nice, I guess, for whoever uses those, I personally always hide search, task view and Cortana and have a taskbar that shows only... tasks. With "never combine", as only that makes sense.

KR

@Gaurav-Original-ClassicShellTester
Copy link
Author

Gaurav-Original-ClassicShellTester commented Aug 30, 2021

Absolutely agree 100%. Centering Win+X or Start button is a mistake. It should be in the corner. It is a hot corner, very easy to reach with the mouse by just shoving the pointer without accurately positioning it over Start button. They broke it in the default setting of the new taskbar.

Even in the Settings app, the Back button no longer touches the top left corner like it does in Windows 10 Settings. I see plenty of bad UI all around in Windows 11. For no reason, toast notifications are moved to the bottom right, unlike Windows 10 where they appear on top right. Unless the notification is cleared, any menus or UI produced by tray icons appear behind the notifications. I have been using Windows since 3.1/95 and I see some very regressive changes, more and more since Windows 8, which are not centered around productivity, usability, accessibility.

Yes an app to launch widgets is a fantastic idea. Even a simple AutoHotkey script would be able to just send Win+W keystoke. With it compiled to an EXE, it can be pinned anywhere to the taskbar. But a full fledged app from a developer can even be located in the notification area / system tray to launch Widgets when required.

Tell me if it's alright to contact you on your email for private communication about testing your apps, or any ways I can assist you or collaborate with you on your projects. I don't have coding / development skills, computers is just a very passionate hobby. But my knowledge and passion for Windows is huge.

Update: I emailed you.

@Gaurav-Original-ClassicShellTester
Copy link
Author

Among other features, one of the nice features of the classic context menu was that a right click not only opened it but the commands in it could also be operated by right click. The new menu breaks that as well. Of course, ExplorerPatcher fixes that by bringing the classic ones back by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

2 participants