Hi,
I am developping an app using managed C++. I want to be able to do a
drag drop from the app to windows explorer. The files to be dropped
onto explorer do not exist yet, the files are to be created by the app
when the user does the drop into explorer.
I have done some searches and found COleDataSource::DelaySetData could
be useful but this is MFC and I can't find the equivalent in .NET.
Anyone know the .NET equivalent for DelaySetData or any other way I can
accomplish what I want to do?
Many thanks,
Nick
Doug Harrison [MVP] - 17 Jan 2007 18:46 GMT
>Hi,
>
[quoted text clipped - 11 lines]
>Many thanks,
>Nick
I think you need to handle CFSTR_FILECONTENTS as described here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platfor
m/shell/programmersguide/shell_basics/shell_basics_programming/transferring/data
scenarios.asp?frame=true
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platfor
m/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clip
board.asp
The .NET object you would use is DataObject, but according to this message
(7/2003), it doesn't support the CFSTR:
http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms/br
owse_frm/thread/6c3ac66fb21491bd/85f6cdf119d9f156?#85f6cdf119d9f156
That message essentially recommends reinventing COleDataSource. Maybe
codeproject.com can help you more with this. For example, Nish's article
shows how to do this with COleDataSource:
http://www.codeproject.com/tips/ExplorerDelayDrop.asp?df=100&forumid=340689&exp=
0&select=1724080

Signature
Doug Harrison
Visual C++ MVP