Page 1 of 1

Dropfile command

PostPosted: Mon Apr 30, 2012 12:01 pm
by dpayer
I was even unaware of this command until today!

When I attempted to use it I ran into a problem. It works fine with the example of dropping a file onto notepad.exe.

I attempted to drop an XML file onto Internet Explorer. I can do that directly using window file explorer and it will display the XML in the browser as expected. If I attempt doing so with the dropfile command, I get the error:

Error
Application does not accept dropped files.

and then the browser will display its home page.

Is this an error on my behalf or a limitation of the command/and/or the application? This can be duplicated by creating an app with one button and with this action for the button:

Code: Select all
FileOpenBox "Select File" "Any File|*.*" "c:\" "[selectedfile]" ""
DropFile "c:\program files\internet explorer\iexplore.exe" "[selectedfile]"




David P.

PostPosted: Mon Apr 30, 2012 12:05 pm
by Neosoft Support
Microsoft hasn't documented the drop file feature, so it had to be reverse engineered. It may not work with all applications. I can't explain why Microsoft would implement it one way in Notepad and another way in Explorer.

PostPosted: Mon Apr 30, 2012 12:09 pm
by dec
Hi,

Take a look if can be a problem with privileges. You cannot drop files from one program to another if these programs don't have the same running privileges. And I think this cannot be only occur if you run your publication as an admin or the other program as an admin: maybe Internet Explorer (due to this program characteristic) run in certain privileges with not match with other programs like your publication. Of course I'am don't sure if this is the case, but maybe it's.

PostPosted: Mon Apr 30, 2012 1:05 pm
by dpayer
Neosoft Support wrote:Microsoft hasn't documented the drop file feature, so it had to be reverse engineered. It may not work with all applications. I can't explain why Microsoft would implement it one way in Notepad and another way in Explorer.


I wonder if it would be possible to have the dropfile command work like the "send to" menu item in the file explorer. When I added a lnk of Internet Explorer to the "send to" folder (in Win7 it is C:\Users\Username\AppData\Roaming\Microsoft\Windows\SendTo ) and then I sent the same files to the IE via 'Send To' they loaded as expected.

Now all you have to do is reverse engineer how the 'send to' folder works! :)

David P.

PostPosted: Tue May 01, 2012 11:16 am
by Neosoft Support
If the file is associated with the program you want to display it, you can just pass the file name to the Run action. For example:

FileOpenBox "Select File" "Any File|*.*" "c:\" "[selectedfile]" ""
Run "[selectedfile]" "" "Normal"