Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I've created an cascade menu in Explorer for Windows 11
based on the info from How to Create Cascading Menus with the SubCommands Registry Entry (Windows) | Microsoft Learn[^]

Private Sub MnuRightKlik_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuRightKlik.Click
    Dim Reg_ClassRoot As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot

    Reg_ClassRoot.CreateSubKey(".mzk").SetValue("", "WinMuziek")
    Try
        Reg_ClassRoot.DeleteSubKey("WinMuziek", False)
        Reg_ClassRoot.DeleteSubKey("WinMuziek\Menu", False)
    Catch ex As Exception

    End Try
    Reg_ClassRoot.CreateSubKey("WinMuziek").SetValue("", "WinMuziek")
    If (Reg_ClassRoot.CreateSubKey("WinMuziek" & "\DefaultIcon").GetValue("") = "") Then
        Reg_ClassRoot.CreateSubKey("WinMuziek" & "\DefaultIcon").SetValue("", Application.ExecutablePath & " ,0")
    End If

    Try
        Dim r1 As RegistryKey = Reg_ClassRoot.CreateSubKey("WinMuziek\shell\WinMuziek", RegistryKeyPermissionCheck.ReadWriteSubTree)
        With r1
            '.SetValue("SubCommands", "Windows.delete;Windows.properties;Windows.rename;Windows.cut;Windows.copy;Windows.paste", RegistryValueKind.String)
            .SetValue("MUIVerb", "WinMuziek", RegistryValueKind.String)
            .SetValue("Icon", Application.ExecutablePath & " ,0")
            .SetValue("ExtendedSubCommandsKey", "WinMuziek\Menu")
        End With

        Dim rMenu As RegistryKey = Registry.ClassesRoot.CreateSubKey("WinMuziek\Menu\shell\Play", RegistryKeyPermissionCheck.ReadWriteSubTree)
        With rMenu
            .SetValue("MUIVerb", "Spelen")
            .SetValue("Icon", Application.ExecutablePath & " ,0")

            Registry.ClassesRoot.CreateSubKey("WinMuziek\Menu\shell\play\command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", Application.ExecutablePath & " ""%1""")
        End With
    Catch ex As Exception
        MsgBox("Registration failed. Try run it as administrator.")
    End Try
    
    SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0) 'tell explorer that there are new fileextensions
End Sub


The menu works fine however with Windows 11 there are now 2 cascade menu's the first menu where the menu may not appear and the second after "clicking more options"

My problem is that the menu partially appear in the first menu with my option but without text.

Image

of course there are more options than 1.Otherwise it would be ridiculous to create a submenu.

What I have tried:

Looking for some switches/options
changing names
Posted
Updated 12-Oct-23 23:30pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900