I'd like to have a program that runs in the background, listens for any file transfers, and then cancels explorer's file transfer mechanism, and starts it's own.
How do I do this? Is there some dll that I can pinvoke?
Why?
* By file transfers I mean moving/copying files/folders via drag and drop, but I am only concerned with file transfers from disk to disk, not from the internet.
Define "file transfer".
Do you want to sniff for ftp, http requests? Explorer copies as well? Local only or on the network?
I think this is bound to get brittle. Your best bet would be if explorer let's you hook into file copy operations via a shell extension. I'm not sure whether it can be done.
See The Complete Idiot's Guide to Writing Shell Extensions for a starting point.
See also http://msdn.microsoft.com/en-us/library/cc144063(v=vs.85).aspx