Print Page | Close Window

Drag-n-Drop between two CXTShellListCtrl's

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6290
Printed Date: 13 July 2025 at 12:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag-n-Drop between two CXTShellListCtrl's
Posted By: larryp
Subject: Drag-n-Drop between two CXTShellListCtrl's
Date 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



Replies:
Posted By: larryp
Date Posted: 01 February 2007 at 12:23pm

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);

}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net