NMS Posted Sunday at 01:50 PM Posted Sunday at 01:50 PM I've been stuck on this topic for a while now. I'm talking specifically about the modern context menu of windows 11 meaning tweaking registry doesn't work outside of "Open with". Notepad++ was my first helping hand so I've looked into the nppshell.dll on github but I have no experience with that language and even with AI I couldn't modify the file even though it was "guiding me through the process". What I'm trying to achieve is create a single menu option with a submenu that will have various other options depending on the extension. I'm not looking for someone to write me the code just point me in the right direction.
KaFu Posted Monday at 11:43 PM Posted Monday at 11:43 PM (edited) Maybe something like this? https://learn.microsoft.com/en-us/windows/win32/shell/context-menu-handlers Edit: And in SMF I use something like this for optional shell integration. RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF for duplicate files", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search with SMF for duplicate files\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l -duplicates""") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF for duplicate files", "Icon", "REG_EXPAND_SZ", """" & @ScriptFullPath & """") RegWrite("HKEY_CURRENT_USER\Software\Classes\Drive\shell\Search with SMF for duplicate files\command", "", "REG_SZ", """" & @ScriptFullPath & """ ""%l -duplicates""") and this in ICU for integration into desktop context menu RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "MUIVerb", "REG_SZ", "ICU") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "Position", "REG_SZ", "Bottom") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "Icon", "REG_EXPAND_SZ", @ScriptFullPath & ",0") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\shell\ICU_ContextMenu_Anchor", "ExtendedSubCommandsKey", "REG_SZ", "DesktopBackground\ContextMenus\ICU") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU", "Icon", "REG_EXPAND_SZ", "shell32.dll,-22") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU", "MUIVerb", "REG_SZ", "Open ICU Settings") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\001_ICU\command", "", "REG_EXPAND_SZ", @ScriptFullPath) RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "Icon", "REG_EXPAND_SZ", "shell32.dll,-7") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "MUIVerb", "REG_SZ", "Save Desktop Layout") RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU", "CommandFlags", "REG_DWORD", 0x040) ; ECF_SEPARATORAFTER RegWrite("HKEY_CURRENT_USER\Software\Classes\DesktopBackground\ContextMenus\ICU\Shell\002_ICU\command", "", "REG_EXPAND_SZ", @ScriptFullPath & " save") Edited Monday at 11:48 PM by KaFu argumentum 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
NMS Posted yesterday at 11:41 AM Author Posted yesterday at 11:41 AM Thanks for the reply @KaFu however this doesn't work in the modern windows 11 context menu. A solution like this is what I'm looking for but through AutoIt. I don't mind even using that through DllCall function if only I understood what data to pass.
ioa747 Posted yesterday at 12:33 PM Posted yesterday at 12:33 PM I don't know, I'm still at 10 but I've seen that it can change How to restore the classic right click context menu for Windows 11 (Revert to Windows 10 Style) I know that I know nothing
NMS Posted yesterday at 02:01 PM Author Posted yesterday at 02:01 PM I'm aware that it can change that's why I brought up the notepad++ example. From what I've read it requires a fairly extensive knowledge of C as it's done in a completely different way. With registry, you can only add custom option into the "Open with" menu which is a workaround I might settle for now. Perhaps I'll simply add an option with registry there and then once selected "Open with My program" I'll reopen the context menu at old position and MyProgram will create an identical looking submenu to sort of act like a native context submenu but that will definitely introduce delay since opening context menu on win11 takes a while. And no, I'm not looking into bringing back the old context menu as eventually that will be gone and it doesn't fit well with the modern look of windows 11.
Solution WildByDesign Posted yesterday at 02:36 PM Solution Posted yesterday at 02:36 PM The last time that I looked into it, you had to pay a hefty price for a digital signature cert to sign your binaries with. Without the digital signature, the sparse package identity stuff would be invalid. It might be possible to have a self-created certificate installed locally but I am not 100% sure if that would work or not. In the old days, context menus would get filled up with so much garbage from so many apps. So I guess this newer method will prevent much of that. But unfortunately it also makes it more difficult and costly.
NMS Posted yesterday at 03:03 PM Author Posted yesterday at 03:03 PM @WildByDesign I did run into someone already mentioning sparse package manager and having to register the application along with other things that I didn't understand as it was C language specific. Then for now I'll stick with my workaround until I learn a thing or two about certificates and whatnot. Thank you for that. WildByDesign 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now