Re: How to accept drag-drop files from SVN
There are more than one way of doing this.
One is to have a COleDropTarget and register your window with it.
To do this I normally use multiple-inheritance:
class CMyDialog : public CDialog, public COleDropTarget
{
.....
};
And in the OnInitDialog method call register, then you can also handel the
COleDropTarget events in the same class.
This gives you compete control over the drag and drop operation, like
displaying a can't accept icon when wrong type file is dragged over your
window.
(This shows how to do it for a Listbox, the code is almost exactly the same
for a dialogbox)
http://www.codeproject.com/KB/combobox/oledragdroplistbox.aspx
The other method is to catch WM_DROPFILES in your dialog box, this will only
tell you when something is dropped on your window and you will then be able
to either open it or display a message saying that you couldn't open it.
http://www.codeproject.com/KB/dialog/JibDragDrop.aspx?fid=26212
AliR.
"Abbott Zhang" <aqian2006@gmail.com> wrote in message
news:6e3a7736-c223-4f3e-bf81-e3f8feaa6855@x1g2000prh.googlegroups.com...
When I use subversion(TortoiseSVN ) in my project. I always drag-drop
files from SVN browser to my desktop. I also find that it is work when
I drag-drop files to Firefox or Notepad++(not worked on MS notepad).
I am wondering how to accept the drag-drop files from in MFC dialogue
based program.I have tried handleing message WM_DROPFILES but it does
not work!
Anyone who have any ideas?
Thank you very much.