Jump to content

Recommended Posts

Posted

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.

Posted (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 by KaFu

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...