therks Posted February 23, 2007 Posted February 23, 2007 (edited) *Edit: Okay, so I figured out the first error I was getting, but I still get the second one. Anybody have any ideas?Any idea how I could get this to work? From what I've read, it's supposed to give me the default IE file download dialog (allow me to choose a place to save the file, then the usual download window with progress bar etc). But all I get is a couple errors.$sFile = 'http://www.therks.com/public/toby/toby.jpg' DllCall('shdocvw.dll', 'int', 'DoFileDownload', 'str', $sFile)First error:AutoIt v3: AutoIt3.exe - Entry Point Not Found (window title)The procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLLSecond error:Security Alert (window title)Your current security settings do not allow this file to be downloaded.Any help would be appreciated. I just wanted a simple call to the default dialog, don't want to recreate my own.Thanks! Edited May 11, 2007 by Saunders My AutoIt Stuff | My Github
therks Posted February 28, 2007 Author Posted February 28, 2007 Soooo... no one as any ideas? Sorry for bumping, I'll only do it this once. Later. My AutoIt Stuff | My Github
/dev/null Posted February 28, 2007 Posted February 28, 2007 First error:AutoIt v3: AutoIt3.exe - Entry Point Not Found (window title)The procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLLPSAPI.DLL??? Where do you call that DLL? Is there more code?Second error:Security Alert (window title)Your current security settings do not allow this file to be downloaded.AFIAK the string has to be in UNICODE format! __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
therks Posted February 28, 2007 Author Posted February 28, 2007 Answer 1: Nope. What you see there is what I used. All by it's lonesome. Answer 2: Damn. So that means I won't be able to use it, right? Seem to remember reading in a request thread for Unicode that it's too hard to implement into AutoIt. Ah well. Thanks for the answer! My AutoIt Stuff | My Github
therks Posted April 29, 2007 Author Posted April 29, 2007 "Rise from your grave" </Altered Beast> Sorry to revive a dead thread, but now that AutoIt supports unicode format, it's plausible that this function should be workable, right? I figured out the first error. It looks like the psapi.dll that ships with AutoIt doesn't have that function within it, so I just deleted that one, and now it's using the one in my system32 folder. The only error I get now is the security settings one. My AutoIt Stuff | My Github
therks Posted May 11, 2007 Author Posted May 11, 2007 Another bump, so I guess I lied when I said I'd only do it once, but with the new releases with unicode support, this should be possible, right? My AutoIt Stuff | My Github
therks Posted February 29, 2008 Author Posted February 29, 2008 *bump* I was tempted to create a new thread for this question, but it just seemed rude. My AutoIt Stuff | My Github
Moderators SmOke_N Posted February 29, 2008 Moderators Posted February 29, 2008 (edited) I thought this would work... but I keep getting the same error:$sDURL = 'http://www.therks.com/public/toby/toby.jpg' _DoFileDownload($sDURL) Func _DoFileDownload($sURL) Local $hModOLE = DllOpen("ole32.dll") If @error Then Return SetError(1, @error, 0) DllCall($hModOLE, "int", "CoInitialize", "uint", 0) If @error Then Return SetError(2, @error, 0) Local $hModSHD = DllOpen("shdocvw.dll") If @error Then Return SetError(3, @error, 0) Local $nBuffSize = StringLen($sURL) * 2 Local $tStruct = DllStructCreate("byte[" & $nBuffSize + 2 & "]") Local $tBuffer = DllStructCreate("byte[" & $nBuffSize & "]", DllStructGetPtr($tStruct) + 2) Local $aMBWC = DllCall("kernel32.dll", "int", "MultiByteToWideChar", _ "int", 0,"int", 0, "str", $sURL, "int", StringLen($sURL), _ "ptr", DllStructGetPtr($tBuffer, 1), "int", $nBuffSize) If @error Then Return SetError(4, DllClose($hModSHD) + DllClose($hModOLE), 0) Local $aDFD = DllCall($hModSHD, "int", "DoFileDownload", "wstr", DllStructGetData($tBuffer, 1)) If @error Then Return SetError(5, DllClose($hModSHD) + DllClose($hModOLE), 0) Return DllClose($hModSHD) + DllClose($hModOLE) EndFunc I don't know really, maybe something to chew on a bit. Edit: Had str for one of the params for DllCall to shd, should have been wstr. Anyway, I also tried DoFileDownloadEx and that doesn't work either... Even with security settings on low (Win XP Pro SP2)... But it did work on Win 2k. Edited March 1, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
The Kandie Man Posted March 1, 2008 Posted March 1, 2008 (edited) I think this may let you do it, but it requires you to reset Internet Explorer's security settings. Ultimately, this simply scares me because on my high level custom IE security settings, I still feel like I am dropping trow every time I use IE to go on the internet. Luckily for me, I only use IE for checking my M$ email accounts. I use Firefox exclusively for everything else.Article regarding making changes in security to get rid of the problem:http://support.microsoft.com/kb/899630I think the best solution would simply be to write your own script with a GUI for download progress. I have one that I wrote that mimics that of an IE download. Let me know if you are interested Saunders.- The Kandie Man ;-) Edited March 1, 2008 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire
Moderators SmOke_N Posted March 1, 2008 Moderators Posted March 1, 2008 I think the best solution would simply be to write your own script with a GUI for download progress. I have one that I wrote that mimics that of an IE download. Let me know if you are interested Saunders.He did indeed write a nice one... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
therks Posted March 1, 2008 Author Posted March 1, 2008 Colour me interested. I've started to make one myself several times but always gave up because I couldn't get some aspect of the implementation to work. I think the big thing for me was the fact that IE always seemed to be able to harvest the proper filename, even when the URL didn't contain it. (ie: http://site.com/script.php?download=14814 becomes myprogram.exe) My AutoIt Stuff | My Github
rasim Posted March 1, 2008 Posted March 1, 2008 (edited) Hi! If you know Visual Basic syntax mayb this helped to you? Edited March 1, 2008 by rasim
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