SharpAffair
SharpAffair

Reputation: 5478

DoDragDrop - get target window handle

I'm using the following code to dragdrop data from listbox into another applications:

Dim data As New DataObject(DataFormats.UnicodeText, ListBox1.Text)
ListBox1.DoDragDrop(data, DragDropEffects.Copy Or DragDropEffects.Copy)

How can I get a handle of the window that receives the data?

I'm looking to build something like "Finder Tool" in Microsoft Spy++.

Upvotes: 0

Views: 517

Answers (1)

Timores
Timores

Reputation: 14589

I don't think that you can know in which window the drop occurred. This is not the philosophy of drag&drop.

Are you thinking of the 'target icon' that Spy++ shows when you can find a window by moving over the desktop ?

This is not a drag&drop operation, I guess Spy++ sets the current window cursor to the 'target', captures the mouse, and uses the hit testing Windows API to ask what is under the cursor.

Upvotes: 2

Related Questions