How can I determine the source process/hWnd for a Drag and Drop operation from drop target

568 Views Asked by At

My C# Windows application accepts drag operations, and I'd like to be able to identify the hWnd and/or Process ID of the source. Is this possible, and how would I go about determining it?

I've tried getting the active window when the drag-over commences, but if the user has activated other windows during the drag operation (for example, by pressing Alt+Tab one or more times), that isn't very reliable.

I've also tried inspecting the formats on the IDataObject, but that signature isn't enough to reliably identify the source window.

0

There are 0 best solutions below