I have a common use case where I want to do something to one file with another file.
For instance, right now, I have copied some tiles from one folder to another and renamed them. I'd like to turn the original files into symbolic links with the original file names that point to the new copies. That involves copying the old file's name to the clipboard, then creating a symbolic link with the clipboard-saved name that points to the new file.
A much easier way to do this would be with a script. It would be nice if I could right-click drag the new file onto the old file and simply select, "Replace this file a symbolic link to the dropped file."
To do this, Directory Opus would have to modify some registry entries. The handler should be temporarily added when the macro is active, then removed when finished. (A log of alterations should be kept so it is possible to back out of the modifications gracefully if Directory Opus is terminated of the computer is reset.) I don't know if drop target can be implemented for all files (*), but if not, a handler can be added for specific extensions (possibly overriding an existing handler). The registry changes would be like thus to make, say, .mkv into a drop target:
HKEY_CLASSES_ROOT <no change required>
.mkv <no change required>
(Default) = WMP.PlayMedia <no change required>
CLSID
{00000000-1111-2222-3333-444444444444} <CLSID of Directory Opus, if doesn't already exist>
InProcServer32
(Default) = C:\Program Files\GPSoftware\Directory Opus\drophandler.dll
ThreadingModel = Apartment
WMP.PlayMedia
shellex <possibly added>
DropHandler <possibly added>
(Default) = {00000000-1111-2222-3333-444444444444} <possibly replaced>
Now the drophandler.dll has to handle IUnknown, IPersistFile, IDropTarget.
See https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/cc144165(v=vs.85)
When a file is dropped on the .mkv, the .dll will be called, and directory opus can pass both the dropped and dropped-on files to the script in question. The script can this delete/rename/move/whatever based on the two incoming files.
Alternatively, this functionality could be implemented as a lister-only capability and not involve the registry at all. In that case, the drag-drop->script functionality would only work within the lister windows.