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