I created an item in the context menu of Window Explorer. I hooked the exe to:

HKEY_CLASSES_ROOT\*\SHELL
HKEY_CLASSES_ROOT\Directory\shell
HKEY_CLASSES_ROOT\Folder\shell

It works fine on single files!

Only problem is when I select multiple files, it runs multiple instance of the exe hooked to that context menu.

How can I make it so that it take in all selected files as parameters but only fires off the instance only once? Similar to a software called "Beyond Compare".

Does it have to do something with the registry - Reg_Multi_SZ with %1?