Common controls normally begin a drag operation in response to the LVN_BEGINDRAG message. You can also take advantage of this message to begin the drag operation. This is where the similarity with Common control drag and drop ends. Common control drag and drop uses mouse messages to control tracking the drag image and processing the drop. You will not be able to use mouse messages because, after you begin the drag operation, control is passed to OLE's DoDragDrop() function.
LVN_ENDDRAGSee Also NMLISTVIEW | WM_NOTIFY | List-View Controls MessagesRequirements OS Versions: Windows CE 1.0 and later. Header: Commctrl.h. This message notifies a list-view control parent window about the end of default processing for a drag and drop operation. It is sent in the form of a WM_NOTIFY message. LVN_ENDDRAG pnmv = (NM_LISTVIEW FAR *) lParam; Parameters pnmv Pointer to an NMLISTVIEW structure. The iItem member identifies the dragged item, and the ptAction member specifies the screen coordinates of the drop location. The other members are zero. 根据这个消息发生的位置(ptAction),自己判断需要做什么动作
拖拉可能会产生两种动作,如果鼠标移出窗口,就产生一个Shell文件拖放操作,被拖出去的item所代表的文件将被创建出来;而如果鼠标没有移出窗口,就产生一个内部item重新排序的动作,这两个动作现在看来都是从OnBeginDrag函数开始的,我该如何区分这两个动作呢?
NMLISTVIEW | WM_NOTIFY | List-View Controls MessagesRequirements
OS Versions: Windows CE 1.0 and later.
Header: Commctrl.h.
This message notifies a list-view control parent window about the end of default processing for a drag and drop operation. It is sent in the form of a WM_NOTIFY message. LVN_ENDDRAG pnmv = (NM_LISTVIEW FAR *) lParam;
Parameters
pnmv
Pointer to an NMLISTVIEW structure. The iItem member identifies the dragged item, and the ptAction member specifies the screen coordinates of the drop location. The other members are zero. 根据这个消息发生的位置(ptAction),自己判断需要做什么动作