Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you show the Windows Explorer context menu from a C# application?

I have a file listing in my application and I would like to allow people to right-click on an item and show the Windows Explorer context menu. I'm assuming I would need to use the IContextMenu interface, but I'm not really sure where to start.

like image 957
Jon Tackabury Avatar asked Jan 16 '09 17:01

Jon Tackabury


People also ask

How do I display the context menu?

A. Pressing Shift-F10 will bring up the context menu for any selected item. Just pressing F10 shifts the cursor focus to the first menu item (normally File).

How do I get to the Windows context menu?

To open the context menu, right-click (or press and hold) on a file or folder in File Explorer. To find commands from the previous Windows 10 context menu: Right-click (or press and hold) on a file or folder to open the context menu. Select Show more options.

How do I show the menu in File Explorer?

To open the Preview pane (it isn't open by default), click on the View menu at the top of File Explorer, then click on the Preview pane button located at the left-hand side of the Ribbon in the Navigation pane area.

How do I get my context menu back?

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

I have written a library that might be able to help you. You could use the controls provided by the library, or if you don't want to do that, looking through the code may give you an answer.

You can find the library at: http://gong-shell.sourceforge.net/

Please let me know if this helped!

like image 166
Grokys Avatar answered Oct 01 '22 22:10

Grokys