D
D
Denis Goncharenko2018-05-08 09:26:56
Command line
Denis Goncharenko, 2018-05-08 09:26:56

How to open the default context menu for a file?

You need to open a context menu, exactly the same as what opens when you right-click on a file. That is, I have some kind of representation of the list of files, and by clicking on them with RMB, a context menu should open, the same as in Explorer.
As far as I understand, there are 2 ways to solve this problem. The first is to somehow programmatically open the context menu for the file at the specified location and place this context menu in the right place. The second is to get all the items of this context menu (which seem to be stored in the registry) and assemble your own context menu from these items from these items, but this way seems more laborious and illogical if the first one is possible.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2018-05-08
@freeExec

This is available from some WinAPI, here even examples on Sharpe are considered .

C
cicatrix, 2018-05-08
@cicatrix

There is one normal way to do this - to use the mechanism built into the OS.
Everything is described here:
Use Shell ContextMenu in your applications
Here is another demo project, implemented in C#:
C-File-Browser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question