I have created a .NET application and I need to add a reference to it, to windows context menu.
I've did it this way: added HKEY_CLASSES_ROOT\*\shell\myapp\command to my registry
.
It works but starts the same number of instances of my app as the number of files I selected. I really need only one instance of the app.
To start and collect the parameters of all the rest instances, I have implemented mutex
. But I don't think that this is the right way.
For instance, I have watched 7-zip performance in procmon
when I select multiple files -> context menu -> add to archive. Only one instance of 7-zip started. I guess the logic of single instance app when you select multiple files -> context menu -> my app should be done in registry. Could not find any usefull tutorial. Thanks!