jascam / CodePlexFoo

0 stars 0 forks source link

C# ICopyHook implementation based on CSShellExt* #177

Open jascam opened 7 years ago

jascam commented 7 years ago

Hi All,   Referring to my discussion entry (http://1code.codeplex.com/Thread/View.aspx?ThreadId=233347) I'd like to officially request a ICopyHook ShellExtension example written in C# (CLR 4.0). According to Jialiang this will be the next sample he will attack :). Looking forward to seeing a managed CopyHook extension!   Purpose: I'll need it for my application in order to provide better drag and drop support, i.e. to be able to get the drop target in Windows Explorer. See http://winscp.net/eng/docs/dragext for more details why one need it.   Regards, Yves

Migrated CodePlex Work Item Details

CodePlex Work Item ID: '7617' Vote count: '4'

jascam commented 7 years ago

Hello

Thanks for submitting the code sample request!

Yes, I will look into this sample request and write it after I finish another shell extension sample.

This comment was posted by Jialiang on 11/9/2010

jascam commented 7 years ago

Just curious if this request is one the mentioned 5 which are already in development (http://blogs.msdn.com/b/codefx/archive/2010/11/08/please-join-us-to-vote-for-code-samples-topics-and-become-a-star-of-the-month-episode-1.aspx)?

Great initiative btw!

Yves

This comment was posted by ylangisc on 11/15/2010

jascam commented 7 years ago

Any chance to give me an idea when this sample will be finished? Should know it if I need to make another attempt to implement it. Thanks!

This comment was posted by ylangisc on 11/23/2010

jascam commented 7 years ago

This comment was posted by on 12/3/2010

jascam commented 7 years ago

is there any progress on this? i would really love to have something to work on over the holidays.

This comment was posted by nerdfactor on 12/14/2010

jascam commented 7 years ago

hello

I finally finished the preview handler sample requested by another customer on Monday, and I'm now full-time working on ICopyHook one. I will try my best to finish and publish the C# version before Christmas.

This comment was posted by Jialiang on 12/15/2010

jascam commented 7 years ago

thats great news. really thankfull that you take some time out of your day to help

This comment was posted by nerdfactor on 12/15/2010

jascam commented 7 years ago

Thanks Jialiang, your effort is very much appreciated! Yves

This comment was posted by ylangisc on 12/15/2010

jascam commented 7 years ago

Hello

I have finished the copy hook handler code samples. You can download them from:

CSShellExtCopyHookHandler (the .NET 4 C# version) http://1code.codeplex.com/releases/view/57436#DownloadId=189054 VBShellExtCopyHookHandler (the .NET 4 VB version) http://1code.codeplex.com/releases/view/57436#DownloadId=189055 CppShellExtCopyHookHandler (the C++ version) http://1code.codeplex.com/releases/view/57436#DownloadId=189053

The example copy hook handlers hook the renaming operation of folders in Windows Explorer. When you are renaming a folder whose name contains "Test" in the Shell, the copy hook handler pops up a message box, asking if the user really wants to rename the folder. If the user clicks "Yes", the operation will proceed. If the user clicks "No" or "Cancel", the renaming operation is cancelled.

In readme.txt of the samples, you can find the detailed demo steps, and implementation.

NOTE: You must restart Windows Explorer (explorer.exe) process after you install the copy hook handler. The reason is that the shell builds and caches a list of registered copy hook handlers the first time copy hook handlers are called in a process. Once the list is created, there is no mechanism for updating or flushing the cache other than terminating the process. The best option that we can offer at this point is to restart the explorer.exe process or reboot the system after the copy hook handler is registered.

Please try these samples and let me know if they work for you.

I'm working on the other code sample requests now...

As we are in the beginning of providing the code sample request service, your feedback is really important to us, so that I can prove to my managers that it's a valuable service for customers, and it's a right thing for my managers to invest. Our feedback alias is: onecode@microsoft.com.

Thanks Jialiang Ge

This comment was posted by Jialiang on 12/20/2010

jascam commented 7 years ago

Thanks Jialiang, just read through the README. A short question: Is the .NET 4 Client Profile sufficient on a target machine to run the shell extension?

This comment was posted by ylangisc on 12/20/2010

jascam commented 7 years ago

looks great. thank you very much Jialiang

This comment was posted by nerdfactor on 12/20/2010

jascam commented 7 years ago

Hi, unfortunately this approach only works for folders. Does someone have any idea how to do the same for files? more precisely, how to detect when the user tries to move a file with Explorer (e.g. by choosing "paste" or by pressing CTRL+v) ? after detecting it, how to bypass the standard Explorer move file progress dialog and use your own file move dialog instead? Thank you very much for any hint.

This comment was posted by seguso on 2/7/2011

jascam commented 7 years ago

Hi, Jialiang, I have downloaded the ICopyhook sample and registered it, it gets registered with appropriate entries, but no matter how I try, the CopyCallback never gets called, What could be the issue ? Regards, Haris

This comment was posted by HarisMunawar on 2/26/2011

jascam commented 7 years ago

Hello Jialiang, I have tried the ICopyHook code, the dll gets registered but no matter how I try the CopyCallback never gets called. What could be the issue?, the registry entry for Directory>shellex>CopyHandlers is there. Really stucked in there.

Regards, Haris

This comment was posted by HarisMunawar on 2/26/2011

jascam commented 7 years ago

This comment was posted by on 2/21/2013

jascam commented 7 years ago

Hello, Can someone send me the C# and C++ code, the links posted above are not working, i really appreciated, my email address is: marcelagraz@gmail.com

This comment was posted by nookie on 8/14/2014

jascam commented 7 years ago

This comment was posted by on 8/14/2014