views:

803

answers:

4

I am building a little HTA for personal use, and would like to be able to drag and drop a file to the interface. Once the file is dropped, I would either automatically run it (assuming it fits some parameters I set, like file extension), or at least fill in the input box on the HTA interface.

I've searched extensively, but can't find a solution. Thoughts?

A: 
Tomalak
Thanks for the answer! I was afraid of that. I think I might go with a Prism interface to an HTML page instead of the HTA.
Joshua
+3  A: 

Tomalak, is incorrect in his statement...there is way to do what you want except that you have to add the DropHandler in the registry for HTA files it's really easy to do and once done you will be able to do exactly what your trying to do. I couldn't find much documentation on it, but here is a link to an HTA that was written a long time ago by a guy named Michel Gallant, that shows you how to it: http://www.jensign.com/JavaScience/www/wsh/imager/index.html

When the HTA is launched it looks to see if you have the DropHandler already configured. If you don't it gives you the option for it to configure it for you. Once configure all you have to do is close and reopen the HTA and wallah, there you go Drag and Drop support in HTA files.

mrTomahawk
Nice. Didn't think of that, but you are right of course.
Tomalak
A: 

If you don't want to enable the drop handler, I could imagine a way that this might be possible. It's a bit of a comedy chain, but I could see myself implementing this if I was backed into a corner and needed that functionality.

You can create an IFRAME which has its src as a temp folder somewhere. This folder will be displayed as an Explorer view. You can then drag files into that. Set up a polling routine against that folder to see if there are any new files. And voila, you have a lame way to support drag and drop operations with a given file.

A: 

Go and try google gears which supplies drag and drop.

You can even use mysql in hta.

Google Gears is not available in hta, however, you can create the activexobject in a html file, then include it using an iframe()

after that, you can use the activexobject through the iframe.

GreatGhoul