artwilkes
asked on
drop and drap
I would like to drop and drap a file from an email onto an apps dialog box and then put the file in a specific location. Could you pont me to a good example. This will be a license file that comes in any email after a product ispurchased.
ASKER
Hi I use v++ and mfc.
Hi Artwilkes,
If your app is a dialog based application then it should be quite simple. On your dialog you can put a list box or list control and then programming for it to handle drag and drop to list out all your files moved to your app OR else you can program for directory structure with the controls to put your files directly (Drag and Drop) to the location you want.
One sample is here.
http://www.ucancode.net/Visual_C_MFC_Example/File-folder-drag-drop-vc-example-WM_DROPFILES-RegisterDragDrop.htm
If your app is a dialog based application then it should be quite simple. On your dialog you can put a list box or list control and then programming for it to handle drag and drop to list out all your files moved to your app OR else you can program for directory structure with the controls to put your files directly (Drag and Drop) to the location you want.
One sample is here.
http://www.ucancode.net/Visual_C_MFC_Example/File-folder-drag-drop-vc-example-WM_DROPFILES-RegisterDragDrop.htm
I don't think it's that easy since the data format passed by a drag/drop from mail programs (at least with Outlook the data is passed via an IStream) is different than the format passed when i.e. files/folders are dragged/dropped from explorer (list to path names of existing files), so the application won't recieve a WM_DROPFILES message.
@artwilkes: What kind of window/control do you want this drag/drop functiontality to work with? If it's a CView-derived window it's a little bit easier since you can use its virtual functions OnDragOver and OnDrop and register the view for drop operations using a COleDropTarget member. Otherwise, i.e. if it's a dialog, you'll have to implement it by adding a COleDropTarget derived member to the window and implement the OnDragOver and OnDrop within this class.
ZOPPO
@artwilkes: What kind of window/control do you want this drag/drop functiontality to work with? If it's a CView-derived window it's a little bit easier since you can use its virtual functions OnDragOver and OnDrop and register the view for drop operations using a COleDropTarget member. Otherwise, i.e. if it's a dialog, you'll have to implement it by adding a COleDropTarget derived member to the window and implement the OnDragOver and OnDrop within this class.
ZOPPO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes it's not easy, or even reliable, to drop and drag from a mail client, I am taking it to a windows explorer or desktop first then onto the program. Thanks for the insite.
what kind of application is it? Do you use MFC or pure Win32 API or something else?
ZOPPO