Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Drag-n-Drop between two CXTShellListCtrl's
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag-n-Drop between two CXTShellListCtrl's

 Post Reply Post Reply
Author
Message
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Topic: Drag-n-Drop between two CXTShellListCtrl's
    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
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post 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);

}

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.