• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

CListCtrl drag and drop

Hi all,

I have a drag and drop operation between two list controls.
I'am using CreateDragImage to get the drag image. The problem is , while the mouse is over some point where a drop
operation is not permitted, I need  to change the mouse cursor
to show the user that he cannot drop at that place. Can any one
help me how do i change the Drag Image when the mouse is
over invalid drop targets.
0
Ram072297
Asked:
Ram072297
  • 2
1 Solution
 
gelbertCommented:
You shoud call function CImageList::DragLeave() as soon as your cursor is over invalid target. Take a look at sample in VC++ mfc\general\cmnctrls. They have CListCtrl which does exactly what you are looking for.
0
 
Ram072297Author Commented:
hi gelbert,
   Thanks for that . It was very useful. Is it possible to change
the Drag image to some "CROSS" or something like that ??
0
 
gelbertCommented:
Yes. You should just change cursor shape when you do not display Drag-Drop image. You can use SetWindowLong( if you do not do it then when mouse is moved you would see old cursor and when it stays you will see new cursor)  to set new class cursor and SetCursor to change shape of current cursor.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now