Hi, People. There is a problem with some listview control. When I choose some item in
listview control and try to drag it to treeview control there is no highlighting of treeview
control. I figured out that it is due to SetCapture(); function. Well, I withdrew this function from
there. It is started to highlight the tree view item but when I try to make another draw of the item from
listview the image of listview item captured in the listview window and don't want go there where
I want it to be. What the heck happening, please?
Code:
void CMyListNew::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
CListCtrl& m_ctlList=GetListCtrl();
CPoint point;
int it= pNMListView->iItem;
// TODO: Add your control notification handler code here
POINT pt;
pt.x = 200;
pt.y = 200;
m_pDragImage = m_ctlList.CreateDragImage(0, &pt);
m_pDragImage->BeginDrag(0, CPoint (8, 8));
m_pDragImage->DragEnter(
GetDesktopWindow(), ((NM_LISTVIEW *)pNMHDR)->ptAction);
//SET THE FLAGS INDICATING A DRAG IN PROGRESS
m_bDragging = TRUE;
m_nDropIndex = -1;
m_pDropWnd = &m_ctlList;
//CAPTURE ALL MOUSE MESSAGES IN CASE THE USER DRAGS OUTSIDE OF THE VIEW
//SetCapture();
}