Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Windows shell context menu items?

In Windows Explorer, you right click on a file, a context menu shows up which contains built-in items like 'Send to...' and/or 3rd party actions such as 'zip file with Winzip'. My question are:

  • How to obtain the full list of available menu items for a specific file?
  • For each menu item, how to get the caption?
  • How to invoke a specific menu item action for a specific disk file?

Thank you in advance!

[EDIT]: While other info is absolutely useful, Delphi solution will be much appreciated!

like image 702
Edwin Yip Avatar asked Sep 23 '10 09:09

Edwin Yip


People also ask

How do you access a context menu?

Right-click (or select and hold) on a file or folder to open the context menu. Select Show more options.

How do I get full context menu in Windows?

Enable classic right-click context menu on Windows 11Open Start on Windows 11. Search for regedit and click the top result to open the Registry. Right-click the CLSID key, select the New menu, and select the Key option. Name the key {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} and press Enter.


1 Answers

The key to obtain the Shell Context menu is use the IContextMenu interface.

check this great article Shell context menu support for more details.

UPDATE

for delphi examples you can see the JclShell unit from the JEDI JCL (check the DisplayContextMenu function) and the ShellCtrls unit included in the samples folder of Delphi.

like image 83
RRUZ Avatar answered Sep 28 '22 22:09

RRUZ