Universal DropHandler v0.9.2 ============================ UniDrop is an easy to use library which allows to create drop handlers for any file type and open the dropped files with any application. Like this you can e.g. use scripts as drop target without having to compile a single line. You'll just have to add some entries to Windows' registry. Installation ------------ 1. Copy the file UniDrop.dll somewhere on your hard disk (e.g. to "C:\Windows\System" or to "C:\Windows\System32") 2. Register UniDrop by running regsvr32.exe with UniDrop's full path as parameter in the Run dialog (e.g. Start -> Run... -> regsvr32 "C:\Windows\System\UniDrop.dll") Usage ----- 1. Run RegEdit and display the content of HKEY_CLASSES_ROOT. 2. Make sure that the extension you want to add the drop handler to does exist. If it doesn't, add it through Edit -> New -> Key -> .ext and set the default value to "extfile" or something the like. 3. Make sure that a key named "extfile" (or whatever is set as default value in the extension's key) does also exist. If it doesn't, add it in the same way as before. 4. Add a subkey "ShellEx" to the "extfile" key (if it doesn't exist) 5. Add a subkey "DropHandler" to the "ShellEx" key and set the default value to "{1280606B-2510-4FE0-97EF-9B5A22EAFE52}". 6. Add a subkey "UniversalDropHandler" to the same "ShellEx" key and set the default value to the application that should be called, whenever some files are dropped over a .ext file. If the default value is empty, the drop target file itself is assumed as application (which should work for most scripts and whatever runs, when you double-click it). 7. Optionally you can add two further values to the "UniversalDropHandler" subkey: "Arguments" indicates the arguments that should be passed to the application whenever some files are dropped. These arguments appear at the beginning of the command line. And if the "OmitTarget" value is present, UniDrop passes only the dropped files to the application. Now, whenever you drop some files over a file with the extension .ext, the application is called with the names of the drop target file and the dropped files as arguments: [Application] [Arguments] [Drop target file] [1st dropped file] [...] Or if the application has not been specified: [Drop target file] [Arguments] [1st dropped file] [...] Example ------- You have a script called ReXplace.js which uses a .rex file to handle some text files. You want to be able to drop the text files directly over a .rex file, so that this specific .rex file and the text files are passed to the script. Now all you have to do is to add the following keys to the registry: [you can also copy and paste the following lines into a new file and merge this file into the registry] --- Copy and paste the following lines --- REGEDIT4 ; this registers the extension ".rex" as "ReXplace.Pattern" file type [HKEY_CLASSES_ROOT\.rex] @="ReXplace.Pattern" ; this registers the "ReXplace.Pattern" file type (could also be ; "rexfile" or something similar) - the default value will ; be displayed in Explorer (here: "ReXplace Pattern") [HKEY_CLASSES_ROOT\ReXplace.Pattern] @="ReXplace Pattern" [HKEY_CLASSES_ROOT\ReXplace.Pattern\ShellEx] ; this adds the link to UniDrop to this particular file type [HKEY_CLASSES_ROOT\ReXplace.Pattern\ShellEx\DropHandler] @="{1280606B-2510-4FE0-97EF-9B5A22EAFE52}" ; and this finally sets the ReXplace script as DropHandler ; (with no additional arguments to be added) [HKEY_CLASSES_ROOT\ReXplace.Pattern\ShellEx\UniversalDropHandler] @="C:\\Windows\\System\\ReXplace.js" "Arguments"="" --- Copy until this line --- Now whenever you drop a file over a .rex file, ReXplace.js gets called as following: ReXplace.js [Arguments] [Path to the .rex file] [1st dropped file] [...] You can do this now similar for any extension / file type. As drop handler you can use any executable which can accept parameters (e.g. files with one of the extensions .exe, .com, .js, .vbs, .hta or .bat). Revisions --------- v0.9.2 * Minor bug fixes. v0.9.1 * Recompiled with LCC-Win32, significantly decreasing file size. v0.9 * If the "UniversalDropHandler key" is not found or doesn't contain a default value, the drop target file is itself used as application. * If a value named "OmitTarget" is found in the "UniversalDropHandler" key, the name of the drop target file is not added to the command line. v0.8 * Initial release (2003-03-11) Legal Notes ----------- UniDrop is released as FREEWARE in the hope that it may serve others as well as it serves myself. You are hereby licensed to do anything with this software, as long as you don't modify it or make money out of it. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND. THE AUTHOR CANNOT BE BLAMED FOR ANY CONSEQUENCE RESULTING OF ITS USE. Contact ------- For comments, bug reports and suggestions write to: Simon Bünzli Copyleft © 2003 - 2008 Simon Bünzli Product of zeniko's software.