Under Windows, source application (explorer in your case) creates a stream which is a standard way to access a content as bytes, and registers it with drag drop system using the functions provided by the OS. It can also provide extra details but it is not mandatory since OS figures out the mandatory parts.
Then the drag operation starts and OS itself asks every window or control if they allow dropping any content, support content type (image, text, etc, support the operation (copy, move, etc). OS itself acts as a broker and handles messaging between the target and the source. If target accepts the content, it was given access to the stream which it can read from.
Nice part is a stream can be anything; a file, text on clipboard, output of a console application, random number generator, anything that can read as bytes can be expressed as streams so you can drag a file from browser and drop to the explorer too and it works exactly like this
Latest Answers