wraithdu Posted June 8, 2011 Share Posted June 8, 2011 I'm writing a drag and drop handler shell extension and I would like to be able to get the process from which the drag operation originated. So if you dropped from a 3rd party file manager onto the desktop for example, I'd like to be able to get the PID of the source application (the file manager). Is this possible? So far I'm able to get the destination PID from the window handle of the context menu, but this is not useful for my purpose. Any ideas? Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 8, 2011 Share Posted June 8, 2011 It would help if we had a little background. Are you using AutoIt? C++? .Net? Java? Link to comment Share on other sites More sharing options...
wraithdu Posted June 8, 2011 Author Share Posted June 8, 2011 Sorry: C++, VS 2010, uses ATL, but not MFC. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 9, 2011 Share Posted June 9, 2011 I don't use ATL and am having difficulty finding documentation on it. Stupid common words. Link to comment Share on other sites More sharing options...
wraithdu Posted June 9, 2011 Author Share Posted June 9, 2011 The ATL part isn't really important, but yeah, I'm having the same problem finding any information on it. The best I've found was in the source for SuperCopier where they enumerate the available clipboard formats, looking for one that is used exclusively by explorer. It works for identifying explorer as the source of the drop, but that's about all. Essentially I'm writing an extension to become the default copy/move handler for the system, even on left button drag/drops. However I think this will mess up certain apps like 7-zip, so I want to try and filter the interception. I was hoping for a better solution than SC's, but I've come up empty so far. Link to comment Share on other sites More sharing options...
Valik Posted June 9, 2011 Share Posted June 9, 2011 Have you already looked at TeraCopy? Link to comment Share on other sites More sharing options...
wraithdu Posted June 9, 2011 Author Share Posted June 9, 2011 I have... in fact I'm trying to build similar functionality for FastCopy. TeraCopy does a few things I don't like. It screws up permissions sometimes when moving files on the same volume, resulting in files/folders with the lock icon on Win7. It also doesn't have as many options as FastCopy does for what is copied. I'd love to see Tera's source to see how they do it, but alas no joy there. Link to comment Share on other sites More sharing options...
Administrators Jon Posted June 9, 2011 Administrators Share Posted June 9, 2011 I remember a microsoft dev saying that most explorer problems they got were caused by badly written shell-handers. They _hated_ them Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
wraithdu Posted June 9, 2011 Author Share Posted June 9, 2011 I don't doubt that at all. Link to comment Share on other sites More sharing options...
Valik Posted June 9, 2011 Share Posted June 9, 2011 I remember a microsoft dev saying that most explorer problems they got were caused by badly written shell-handers. They _hated_ them My response would have been: "Don't make writing shell extensions so arbitrarily complex." Link to comment Share on other sites More sharing options...
wraithdu Posted June 11, 2011 Author Share Posted June 11, 2011 (edited) Any users of FastCopy out there that would like to give my shell extensions a try? Basic rundown: - makes FastCopy the default copy/move handler, works for drag and drop and Ctrl-C|X / Ctrl-V - intercepts operations from Explorer and probably most 3rd party file managers, does not interfere with other apps like 7-zip - bypass by holding the left Windows key, the Windows copy handler will be invoked instead - FastCopy has a few different copy modes which can be configured by INI file - set options for general FastCopy behavior in INI file - default options are: /cmd=force_copy /auto_close - both x86 and x64 versions - built with VS2010, so you'll probably need the VC++ 2010 runtimes If you have TeraCopy installed and want to try this, you'll probably have to completely uninstall TeraCopy, since the app does not properly remove the x64 registry entries via the options GUI (works ok for the x86 entries though). I have two extensions and an INI file - drop all three in the FastCopy installation directory, edit the INI for your preferred options (or delete it or leave the defaults), and register the two DLLs. Let me know if interested, and I can send you the files. Edited June 11, 2011 by wraithdu Link to comment Share on other sites More sharing options...
wraithdu Posted June 11, 2011 Author Share Posted June 11, 2011 Note about the 7-zip problem: I thought this was interesting once I figured out what was going wrong. When dragging out of 7-zip, 7-zip first unzips the files to a temp directory, then invokes the shell with the paths to the temp files. It waits for the shell operation to complete then deletes the temp files. In the case of intercepting the copy/move with FastCopy (same problem with TeraCopy or SuperCopier), once the extension invokes FastCopy it returns, which tells 7-zip everything is done even when it is not and 7-zip deletes the temp files before FastCopy can copy them. I tried to make the shell extension wait for FastCopy to finish via a call to WaitForSingleObject, but this actually freezes the ENTIRE shell until it returns. It's not noticeable for quick operations, but on a long unzip, then shell will think it has crashed and you'll get the "not responding" warning. So in the end I can make it works with apps like 7-zip, but the shell doesn't cooperate to make it practical. Link to comment Share on other sites More sharing options...
MHz Posted June 11, 2011 Share Posted June 11, 2011 Have anyone experienced these issues with Explorer? Win XP Gold Explorer crashed before installing any 3rd party software.I have installed XP on many machines and I found it true. I used to test beta XP releases and the last was rock solid. The RTM was terrible as far as explorer was concerned. Solution: SP1+ Win 7 Gold Explorer can cause all processes to become unresponsive. Reboot when happens, expect hanging OS. Shutdown Explorer and open Explorer may help with luck. Solution: Do not keep Explorer open. Close Explorer as soon as you can to avoid trouble. Solution: Avoid long term use. Anyone else got solutions to work around the known Explorer problems? Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 11, 2011 Share Posted June 11, 2011 What do you mean by XP Gold and 7 Gold? And what happened to Vista? Link to comment Share on other sites More sharing options...
Valik Posted June 11, 2011 Share Posted June 11, 2011 http://en.wikipedia.org/wiki/Software_release_life_cycle#RTM Link to comment Share on other sites More sharing options...
wraithdu Posted June 11, 2011 Author Share Posted June 11, 2011 @MHz I'm curious what this at all has to do with my topic? Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 12, 2011 Share Posted June 12, 2011 (edited) Ok, that answers the name, but that doesn't explain the Vista-less-ness. Edited June 12, 2011 by Richard Robertson Link to comment Share on other sites More sharing options...
Varian Posted November 22, 2011 Share Posted November 22, 2011 Any users of FastCopy out there that would like to give my shell extensions a try? Basic rundown: - makes FastCopy the default copy/move handler, works for drag and drop and Ctrl-C|X / Ctrl-V - intercepts operations from Explorer and probably most 3rd party file managers, does not interfere with other apps like 7-zip - bypass by holding the left Windows key, the Windows copy handler will be invoked instead - FastCopy has a few different copy modes which can be configured by INI file - set options for general FastCopy behavior in INI file - default options are: /cmd=force_copy /auto_close - both x86 and x64 versions - built with VS2010, so you'll probably need the VC++ 2010 runtimes If you have TeraCopy installed and want to try this, you'll probably have to completely uninstall TeraCopy, since the app does not properly remove the x64 registry entries via the options GUI (works ok for the x86 entries though). I have two extensions and an INI file - drop all three in the FastCopy installation directory, edit the INI for your preferred options (or delete it or leave the defaults), and register the two DLLs. Let me know if interested, and I can send you the files.This is not a new topic, but I would like to try your files to register Fastcopy as the default copy handler. Are you still working on this? Link to comment Share on other sites More sharing options...
TimurBorn Posted August 19, 2014 Share Posted August 19, 2014 (edited) Ahoi, is this available for download anywhere? Other copy utilities like Perigee make their own Move context-menu entry the default for drag & drop (optionally), but there doesn't seem to be a simple registry hack to make that possible for FastCopy. So it even after all this time your solution is still interesting. Thanks in advance! Edited August 19, 2014 by TimurBorn Link to comment Share on other sites More sharing options...
rcached Posted August 1, 2020 Share Posted August 1, 2020 On 6/11/2011 at 12:05 PM, wraithdu said: Any users of FastCopy out there that would like to give my shell extensions a try? Basic rundown: - makes FastCopy the default copy/move handler, works for drag and drop and Ctrl-C|X / Ctrl-V - intercepts operations from Explorer and probably most 3rd party file managers, does not interfere with other apps like 7-zip ... Let me know if interested, and I can send you the files. Is this a project you finished? Can you send it or provide a link? Even if it's just the code of something partially completed, I'd be interested. Just for my personal use. Perhaps myself and others could pick up the baton and carry it further along, while giving original credit to you, of course. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now