Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Order in the Windows Explorer context menu

How can I change the order of the entries in the context menu?(e.g. for Directories) I need to know how Windows determines the order when showing that so I can control it. For example I want to place my custom action at the end of the context menu list

Thank in advance!

like image 486
ixSci Avatar asked Aug 10 '11 08:08

ixSci


People also ask

How do I change the order of the context menu?

The easiest way to change the order within the "section" is to change the name of the registry key under HKCR-*-shell or HKCR-*-shellex . All under subkey shell will be before them under shellex . Keys that have the CLSID as the key name will be as last entry since they are last in the used order.

What is Windows Explorer context menu?

A context menu is a pop-up menu that provides shortcuts for actions the software developer anticipates the user might want to take. In a Windows environment, the context menu is accessed with a right mouse click.

How do I change the context menu in Windows Explorer?

Open File Explorer and right-click any folder to open the context-sensitive menu. Then position ShellMenuView and File Explorer side-by-side (Figure C). Now pick a specific command from the File Explorer menu that you never use and want to remove. Look for its entry in the ShellMenuView window.


1 Answers

My Google-fu led me to this:

So the sorting is based on the following elements in decision order:

  1. Key priority (eg, txtfile, *, AFSO)
  2. Registry Enumeration order of shellex\contextmenuhandlers with a special case for static verbs always being first
  3. IContextMenu Implementation order

So if there is any contention for position, there is no consistent way for an extension to guarantee their relative position within the menu.

Obviously you can't do anything about phase 1. Phase 3 only applies to the verbs implemented in your handler. That leaves phase 2. The only thing you can do is name your entry under ContextMenuHandlers such that it would be enumerated first, but nothing's stopping someone else from doing the same thing.

like image 101
Luke Avatar answered Dec 21 '22 23:12

Luke