Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show Windows Explorer context (right click) menu?

I want to show the Windows Explorer context menu.

I don't want to add my application to it, I just want to display it inside my application.

A good example of the implementation that I need is Total Commander.

If you press and hold right mouse button, TC will show the context menu, which is exactly the same as in Windows explorer.

I'm using C++/Qt, but language is not important here.

like image 846
Alex Avatar asked May 19 '12 19:05

Alex


People also ask

How do I get the old right click context menu back in Windows 11?

Right-click the newly created key, select the New menu and select the Key option. Name the key InprocServer32 and press Enter. Double-click the newly created key and set its value to blank to enable the classic context menu on Windows 11. Click the OK button.

How do I enable right click in File Explorer?

Right-click in the right pane and create a new 32-Bit DWORD value and name it NoViewContextMenu. Giving it a value of 1 will disable the context menu in File Explorer. To re-enable context menu, give it a value 0 or delete NoViewContextMenu. Do remember to create a system restore point first!

Where is the context menu in File Explorer?

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.


1 Answers

I found several samples that may help you. You're not likely to be able to do this with Qt alone, since the shell context menu is highly OS-specific; probably some Win32 calls will be needed also.

  • Use Shell ContextMenu in your applications
  • Explorer Shell Context Menu

A Raymond Chen blog series "How to host an IContextMenu"

And some non-C++ samples also:

  • C# File Browser
  • Shell context menu sample in C#

And related SO questions:

  • How to access Windows shell context menu items?
  • How to obtain full shell context menu of right-click a folder background
like image 127
Ben Voigt Avatar answered Sep 21 '22 18:09

Ben Voigt