Here’s an article I wrote for The Code Project that shows how you can drag and drop a virtual file (one that does not physically exist on disk) from your app into Windows Explorer. It’s useful for scenarios like extracting a file from an archive or where the source file is on a remote machine.
Very cool Nish. I’ve had to write similar C# code to do virtual file drops with explorer. The tricky part for me was to keep explorer waiting while I grabbed the file data from a remote server. Once it’s working, though, it’s pretty cool.
How to translate to C# ?
Hi Nish,
I’m not using MFC, and m supposed to drag virtual file to explorer/desktop as hglobal. The problem m facing is that the Target calls IDataObject::GetData with CFFormat CFSTR_FILEGROUPDESCRIPTOR but then never turns up for CFSTR_FILECONTENTS instead asks for CFSTR_SHELLIDLIST. I’m not very sure why this is happening. Only thing that i’m doing different is that i’m not setting lindex member of FORMATETC (which when i did, didn’t make any difference). Any clues as to why the target doesn’t ask for the file contents
Have you solved this problem yet?, as I have also encountered it
I am glad to have the opportunity to visit this blog,really happy.I am a college of china,I just began my MFC travling, but I face the biggest problem that I don’t know how to choose in that there are so many classes and controls ,functions and etc. I wanna get a introduction about how to begin my MFC Travling,If you have time ,if you will, please do me a favor,So much thanks to you.
HEllo everyone I work for a company that is looking for c++,win32,unix developers in midtown
NYC email me if interested up to 200k total comp
Hi Nish,
Thanks for the excellent article. I was looking for such for some time. My requirement is to drag and drop files between remote systems. I learnt how to drag the files using your help (only difference being that the code is in Win32).I need to know the path where the file gets dropped so that I can transfer the remote file to that particular path.
Can you please spare a few moments for this.
Thanks in advance.
Regards,
Praveen
How can I accomplish this in C#? VB works too! π