View Single Post
Old 06-05-2008   #2 (permalink)
Stefan Kanthak


 
 

Re: Add context menu item for background of open folder window?

"Paul Randall" <paulr901@xxxxxx> wrote:
Quote:

> I want to add a context menu item to the registry that will allow me
> to right click within the white space (background) of an open folder
> window and choose to open a command prompt with the same path as the
> open folder window.
IFF the explorer would use the shell subkey for "Background" the
following would work.

--- .REG ---
REGEDIT4

[HKEY_CLASSES_ROOT\Directory\Background\Shell\Prompt]

@="<your menu entry>"

[HKEY_CLASSES_ROOT\Directory\Background\Shell\Prompt\Command]
@="cmd.exe /K PushD %1"

[HKEY_CLASSES_ROOT\Drive\Background\Shell\Prompt]

@="<your menu entry>"

[HKEY_CLASSES_ROOT\Drive\Background\Shell\Prompt\Command]
@="cmd.exe /K PushD %1"
--- EOF ---

But explorer doesn't evaluate the shell subkey there.
Quote:

> I've searched the newsgroups and found hundreds
> of references to things like "modify the right-click menu of folder
> item", but these always seem refer to the context menu for a folder
> icon, not for the background of an open folder window. I'm hoping
> someone will post code or a URL that explains how to do it.
You'll have to write a shell extension and register that under

[HKEY_CLASSES_ROOT\Directory\Background\ShellEx\ContextMenuHandlers\<your shell extension>]
@="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" ; the CLSID of your shell extension handler


[HKEY_CLASSES_ROOT\Drive\Background\ShellEx\ContextMenuHandlers\<your shell extension>]
@="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" ; the CLSID of your shell extension handler


But leave

[HKEY_CLASSES_ROOT\Folder\Background\ShellEx\ContextMenuHandlers\<your shell extension>]

alone: "Folder" is the superset of "Directory", "Drives" and all the
virtual folders created by the various namespace handlers which
generally are not backed up by a filesystem object, so a "ChDir" or
"PushD" would fail.

Stefan

My System SpecsSystem Spec