Drag-n-Drop between two CXTShellListCtrl's |
Post Reply |
Author | |
larryp
Groupie Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
Post Options
Thanks(0)
Posted: 31 January 2007 at 4:51pm |
Before I go digging into it, I was wondering if there were any examples on dragging files between two CXTShellListCtrl objects. Do any exist? If not, then what are the steps. Do I have to register a drop taget, etc... ? Thanks,
Larry
|
|
larryp
Groupie Joined: 15 January 2005 Location: United States Status: Offline Points: 61 |
Post Options
Thanks(0)
|
I figured it out. The answer is to derive a class from CXTShellListCtrl and add the following code: BEGIN_MESSAGE_MAP(CShellListCtrl, CXTShellListCtrl) ON_WM_DROPFILES() END_MESSAGE_MAP()
void CShellListCtrl::OnDropFiles(HDROP hDropInfo){ TCHAR strSourceFilename[_MAX_PATH]; int nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0 );
for ( UINT i = 0; i < nFiles; i++ ) {
::DragQueryFile(hDropInfo, i, strSourceFilename, _MAX_PATH); // Insert copy file code here }
::DragFinish(hDropInfo); } |
|
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 |