0

Scenario

I'm using Windows 10, but I have the same problem In other Windows versions.

I've added a custom item in my Windows contextmenu, it is intended to be accesible by right-clicking from a directory folder, or from a directory background.

This registry script reproduces my custom contextmenu item (except the subcommands):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\PATHS]
"MUIVerb"="PATHS"
"SubCommands"="PATHS.AddDirBackground;PATHS.RemoveDirBackground"
"Icon"="C:\\Program Files\\PATHS\\PATHS.Title.ico"
"Position"="bottom"

[HKEY_CLASSES_ROOT\Directory\Background\shell\PATHS]
"MUIVerb"="PATHS"
"SubCommands"="PATHS.AddDirBackground;PATHS.RemoveDirBackground"
"Icon"="C:\\Program Files\\PATHS\\PATHS.Title.ico"
"Position"="bottom"

enter image description here


Problem

The problem I have is that Windows seems to treat the desktop background in the same way as a directory background, so my custom contextmenu item is visible when I do right-click on the desktop background:

I don't like this behavior, because this contextmenu item isn't useful when accesible from the desktop background, it only increases the size of the desktop contextmenu in general.


Question

How I could disable my contextmenu item from still appearing on the contextmenu of the desktop background?.

Please note that its a simple contextmenu item manually added via registry, I don't pretend to rework the implementation via shell extension.


Research

In this article I seen a natural methodology or hack to hide or disable any contextmenu item:

enter image description here

However, I'm not sure how to do it neither if that is really what I need.

I tried to add a "ghost" item on the DesktopBackground registry key trying to override the original item that I have on Directory\Background key, but the item still shown when I do right-click on the desktop background:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\shell\PATHS]
"MUIVerb"="PATHS"
"LegacyDisable"=""

Or:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\shell\PATHS]
"MUIVerb"="PATHS"
"Extended"=""

On the other hand, the trick works ok for the original items that are stored in the registry keys mentioned above, but this trick doesn't works for this "ghost" or "dummy" item which is the one that I want to hide from contextmenu.

13
  • 3
    What made you think the desktop was different from a folder? Your Desktop itself is an interface to the contents of a specific folder. What you want to have happen goes against the base core concept of Windows as an operating system
    – Ramhound
    Commented Oct 13, 2015 at 15:13
  • What made you think the desktop was different from a folder? Here is the big difference: HKCL\DesktopBackground\Shell vs. HKCL\Directory\Background\Shell there is one key for desktop shell menu, and one different key for directory shell menu. You said it yourself, it is an iterface, and that means it is not treated in the same way as any other folder because it is a different "representation" with a GUI that covers the screen. Anyways, I think we are not here to discuss what is a desktop environment. At least not in that way... thanks for comment. Commented Oct 13, 2015 at 15:20
  • 1
    It's still a folder. Which is obvious if you open explorer and look for it. It contains other folders and shortcuts.
    – DavidPostill
    Commented Oct 13, 2015 at 15:25
  • 1
    @ElektroStudios - I was very clear. When you say "nothing of nothing", that statement is not clear, it isn't even proper English. You have already indicate what it means, so I indicate you should say that, and not "nothing of nothing".
    – Ramhound
    Commented Oct 13, 2015 at 17:46
  • 1
    This is quite a tedious question, honestly. As already developed, the Desktop is (just) an interface for a folder. If the functionality of your context menu item is pointless on the Desktop then just don't use it.
    – Insane
    Commented Oct 13, 2015 at 23:05

0

You must log in to answer this question.