tags:

views:

137

answers:

2

Hi folks,

We all know you can implement drag-and-drop feature for your Window so that it accepts drag and drop operation, but my question is, how to detect a drag-and-drop operation that's is in progress in other windows, for example, dragging a file in the Windows Explorer? What I want to do is that when a user is dragging a file then my hidden window shows up.

Thank you!

A: 

I use DropMaster from Raize Software. http://www.raize.com/devtools/Products.asp

You can also use from Melander, but i didn't test this one. http://melander.dk/delphi/dragdrop/.

Ravaut123
HI Ravaut, I'm a paid customer of DropMaster, I'm also using the drag and drop component suite from Melander, but they are for implementing standard drag-N-drop operations which means your windows won't get notified until the mouse cursor is dragging over your form, and this is not what I'm asking in this topic. Thanks.
Edwin
A: 

What you are asking for is not natively supported. During a drag&drop operation, only the originator of the drag knows the operation is in progress, and only windows actually being dragged over get notifed that the operation may occur on them.

The only option I can think of right now is to implement a global mouse hook via SetWindowsHookEx() in a DLL and have it keep track of when the user holds down the left button and moves the mouse outside of the source window. But there is no way to get information about what is being dragged.

Remy Lebeau - TeamB
Hi Remy, thanks for the help. It's sad to know that "there is no way to get information about what is being dragged". And since the Delphi DLL's does not work under 64bit windows, maybe it'll better to have a background program to periodically check the left mouse button state?
Edwin
Remy Lebeau - TeamB
Thanks for the further comment, Remy!
Edwin