Click here to Skip to main content
16,014,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Short Question:
How do I support Cut/Paste to/from a .NET app and Windows Explorer?

Full Text:
I'm nearing the completion of a Remote File Management application.
It looks and feels a lot like Windows Explorer. The difference is that it communicates with a remote server via web services. The remote web services store and retrieve the file bits to/from a database... along with some other bells and whistles that Explorer doesn't have.

I've got full support for drag and drop between my app and the desktop/Windows Explorer, but a new requirement has come up that I have to add cut/copy/paste between my application and Windows Explorer. I've got copy working just fine from my Edit/Copy menu (I just do a Clipboard.SetFileDropList(FileCollection) after copying them to a
temp folder), then Windows Explorer can use it's Edit/Paste menu to get
the files. My dilema relates to the "Cut" command:

If the user selects fils and/or folders from my app, then chooses Edit/
Cut from my menu, then goes to Windows Explorer and chooses Edit/Paste, How do I know when Windows Explorer has successfully completed the paste so I can then remove the files from my remote system? I assume there's some sort of system event that I either need to subscribe to or poll?

Same question in reverse. When someone cuts from Windows Explorer and pastes into my app, how do I let Explorer know that I've stored the files successfully, so Explorer can then delete the files locally?
Posted
Updated 20-Nov-14 1:19am
v3
Comments
BillWoodruff 13-Nov-14 5:43am    
The interaction clipboard use you describe with your Application and Windows Explorer: is that only happening on your machine: I understand the user can select files on a remote machine, but the cut/paste you wish involves a paste only on your machine ?

This is one application running on one machine, or the same application running on many machines on a network ?

1 solution

Refer - Drag and drop, cut/copy and paste files with Windows Explorer[^]
Quote:
The most annoying thing was that if you cut from the sample and paste into Explorer, Explorer will move the files for you and take them out of your folder. However, there is no way to get a notification when this paste happens, so it is impossible to keep your view of the files up to date. I implemented a small file watcher which watches the sample folder, but I imagine this could get much more complicated if you need to watch many folders.
 
Share this answer
 
Comments
Member 10955785 13-Nov-14 6:15am    
Ok.. thanks...
Welcome. :) Please accept the answer. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900