Drag & Drop
-
Hi Chaps, Anyone got any drag & drop code examples? having a bit of trouble with the leftbuttonup function and the HitTest() not working properly I did this: void CRunEICDlg::OnLButtonUp(UINT nFlags, CPoint point) { if( m_bDragging ) { ASSERT(m_pimagelist != NULL); m_pimagelist->EndDrag(); CImageList* pTemp = m_pimagelist; m_pimagelist = NULL; delete pTemp; ReleaseCapture(); m_bDragging = false; } // CPoint point; // GetCursorPos( &point ); m_cTestSeq.ClientToScreen( &point ); UINT flags; int item; item = m_cTestSeq.HitTest( point, &flags ); item = item; if( LVHT_NOWHERE | flags ) { // add to end item = item; } else if( LVHT_ONITEM | flags ) { // insert before the item item = item; } // } CDialog::OnLButtonUp(nFlags, point); } But it doesnt recognise when the leftbutton was let go in the listControl window any comments greatfully received The Wudan Master
-
Hi Chaps, Anyone got any drag & drop code examples? having a bit of trouble with the leftbuttonup function and the HitTest() not working properly I did this: void CRunEICDlg::OnLButtonUp(UINT nFlags, CPoint point) { if( m_bDragging ) { ASSERT(m_pimagelist != NULL); m_pimagelist->EndDrag(); CImageList* pTemp = m_pimagelist; m_pimagelist = NULL; delete pTemp; ReleaseCapture(); m_bDragging = false; } // CPoint point; // GetCursorPos( &point ); m_cTestSeq.ClientToScreen( &point ); UINT flags; int item; item = m_cTestSeq.HitTest( point, &flags ); item = item; if( LVHT_NOWHERE | flags ) { // add to end item = item; } else if( LVHT_ONITEM | flags ) { // insert before the item item = item; } // } CDialog::OnLButtonUp(nFlags, point); } But it doesnt recognise when the leftbutton was let go in the listControl window any comments greatfully received The Wudan Master
You've used bitwise-or instead of bitwise-and with LVHT_xxx flags. Tomasz Sowinski -- http://www.shooltz.com