![]() |
Drag and Drop |
Post Reply
|
| Author | |
manoj
Newbie
Joined: 26 October 2004 Location: India Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Topic: Drag and DropPosted: 05 April 2005 at 4:57am |
|
Hi I am using Xtreme Toolkit Pro v9.60, I create a SDI application and create a list control in CXTPDockingPane. Now I want to drag a file and drop in that list control. Please tell me how can i do this if possible then pls send me small sample code.
Manoj Jangid |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 April 2005 at 3:47am |
|
you can use CListView instead of CListCtrl and override members of CView:
DROPEFFECT CView::OnDragEnter(COleDataObject* /*pDataObject*/,DWORD /*dwKeyState*/, CPoint /*point*/){ return 0; // DROPEFFECT_NONE} DROPEFFECT CView::OnDragOver(COleDataObject* /*pDataObject*/,DWORD /*dwKeyState*/, CPoint /*point*/){ return 0; // DROPEFFECT_NONE} BOOL CView::OnDrop(COleDataObject* /*pDataObject*/,DROPEFFECT /*dropEffect*/, CPoint /*point*/){ return FALSE;} |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 April 2005 at 3:52am |
|
Or if you need _only files_ dragging
1. Call m_wndList.DragAcceptFiles(TRUE); 2. Add ON_WM_DROPFILES() to message map 3. add member like
void CYourListCtrl::OnDropFiles(HDROP hDropInfo){ UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0); for (UINT iFile = 0; iFile < nFiles; iFile++){ TCHAR szFileName[_MAX_PATH]; ::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH); Process(szFileName); } ::DragFinish(hDropInfo); } |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |