Link to home
Start Free TrialLog in
Avatar of mrpinko
mrpinko

asked on

Initiating a File DragDrop

Given a tree control or such, How do I initiate a simple file drag drop? there is a simple interface at the drop end, but i can't seem to find an easy begin-drag interface point.

any suggestions?

thanks,
Gavin.
ASKER CERTIFIED SOLUTION
Avatar of Bridge
Bridge

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrpinko
mrpinko

ASKER

OK.. i see. this generates a crsor image which can be moved on mouse moves.
thanks!

to be a little more specific,
with dragging and dropping a *file*, eg. from the windows explorer to my application
CTreeCtrl method  "OnDropFiles" suplies me with the path to the dropped file. How do i go about doing the same thing when transferring a file back the other way? (ie. is there an API interface with which i can define the current drag-and-drop operation as a file drag? and supply the path?

mr pinko.
Avatar of mrpinko

ASKER

OK.. i see. this generates a crsor image which can be moved on mouse moves.
thanks!

to be a little more specific,
with dragging and dropping a *file*, eg. from the windows explorer to my application
CTreeCtrl method  "OnDropFiles" suplies me with the path to the dropped file. How do i go about doing the same thing when transferring a file back the other way? (ie. is there an API interface with which i can define the current drag-and-drop operation as a file drag? and supply the path?

mr pinko.
Use the clipboard format CF_HDROP with the DROPFILES structure.
Avatar of mrpinko

ASKER

hi bridge, thanks for the comments so far.

i can see how the clipboard can be used to transfer data from one window in my application to another *in my applicataion* using the code given above.
however, this does not help (me at least) in the case where the windows explorer or desktop or other application is the target of the file drag!

it seems to me that i should be able to place the file names on the clipboard (or whatever) and then initiate a "kernel-controlled" or "system-wide" file drag. In such a case, the OS sends a WM_FILEDROP message to teh target window at the correct time.

how are inter-application file drops achieved? is my intuition totally flawed?

thanks,
Gavin.