Archived

This topic is now archived and is closed to further replies.

Showing image when dragging across views

This topic is 5874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a couple of CTreeViews (with CTreeCtrls )in my sdi mfc app. I need to be able to drag a folder from the top tree ctrl to populate the bottom control (using the dragged item as the root). I can do this without drag images no problem however I need to be able to show the icon of the item (for example if i were to drag the c: drive icon, then next to the cursor while i am dragging i want the c drive icon plus the text c. I can do this fine within the same view (i.e. when i begin dragging then the drag image follows the mouse cursor) but when my cursor moves to the next view the image stops and stays within the first view. How can I get the image to follow the mouse cursor across views as it does with windows explorer (if you were to drag a folder to the right hand pane the drag image follows it across). Ive tried doing this by getting a pointer to the top CTreeCtrl and using that image to CreateDragImage() in the bottom CTreeCtrl and it nearly works. Now when my mouse goes into the bottom view the image doesnt stop it keeps on moving where the cursor is (bearing in mind that the drag image is a bit higher than the mouse anyway- gotta fix that once ive done this) but if the image gets down to the splitter then it just disappears (as if its going behind the pane rather than in front. Well if anyway can decipher my insane ramblings enough to understand what im getting at and can help, your help would be most appreciated. Thanks very much.

Share this post


Link to post
Share on other sites