Jump to content

Recommended Posts

Posted

In my computer it answers

"Your current security settings do not allow this file to be downloaded."

and I have no idea how to change for testing.

But YOU may like it. :)

$sFile = 'http://crimsonfan.altervista.org/run.zip'
$a = DllCall("shdocvw.dll",'int','DoFileDownload','string',$sFile)
Posted

yeah, it seems to say that no matter what the file you're trying to download is... wierd

I have a catapult. Give me all the money or I will fling an enormous rock at your head.

Posted

hm, just found something that says that function needs the string in unicode, would have to use MultiByteToWideChar in kernel32 to convert it... starting to sound like a pain...

I have a catapult. Give me all the money or I will fling an enormous rock at your head.

Posted

I am pretty sure I am close...

$url = 'http://crimsonfan.altervista.org/run.zip'

$ln = StringLen($url)
$space = ""

for $i = 0 to 3 * $ln
   $space = $space + " "
Next

$res = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "int", 1, "long", "", "str_ptr", $url, "long", -1, "str_ptr", $space, "long", $ln, "long", "")
$a = DllCall("shdocvw.dll",'int','DoFileDownload','str',$res[5])

converted from this:

MultiByteStr$ = "http://david.oslb.net/index.htm" + chr$(0)
    CodePage = 1 ' CP_OEMCP
    chMultiByte = -1
    chWideChar = len(MultiByteStr$)
    WideCharStr$ = space$(3 * chWideChar)

    calldll #kernel32, "MultiByteToWideChar", _
        CodePage     as ulong, _
        Flags         as ulong, _
        MultiByteStr$ as ptr, _
        chMultiByte as ulong, _
        WideCharStr$ as ptr, _
        chWideChar    as ulong, _
        result        as ulong

    file$ = WideCharStr$

    Open "Shdocvw.dll" for dll as #shdocvw

    CallDLL #shdocvw, "DoFileDownload", _
        file$ as ptr,_
        ret as long

    Close #shdocvw
end
Who else would I be?
Posted

1) What's str_ptr? All strings are pointers since they of integral type char*.

2) You are attempting to store a wchar_t in a char. What do you think the odds are of that working? Here's the output in the return array:

104 0 116 0 116 0 112 0 58 0 47 0 47 0 99 0 114 0 105 0 109 0 115 0 111 0 110 0 102 0 97 0 110 0 46 0 97 0 108 0

Thus, an h prints and thats it.
Posted

Well, Valik, I am only trying to make it work. I have absolutely no idea what I am doing, which you have proved. Have you any better ideas on how to do the conversion?

Who else would I be?
Posted

@Valik, Do I understand that autoit cannot even store such a value? If so, then it does look impossible.

@Python, it is not a mistake.

@ezzetabi, For the comments from python, he is used to a website called altavista.com Your url looks like a mistake to him, which it is not. For the part of the code, If Valik validates my assumption, then autoit will only be able to do this when autoit has full support for unicode. That, as we all know, is not going to happen soon.

Who else would I be?
Posted

About BlackDiablo: oh yeah. I forgot the lack of his brain activity.

About the DllCall: Pity. Well, we already have InetGet() so it is not a problem at all.

Still, it is strange that a download Func accepts only unicode where internet addresses often don't.

:)Do you like the lastest version of Run!?

Posted

That is correct, this-is-me, it's not currently possible to store a wide character correctly because AutoIt internally uses a multi-byte character.

Guest Py7|-|[]/\/
Posted

I didn't know it was a real website. I just looked at the name and it reminded me of www.googler.com. I don't know why.

  • 1 month later...
Posted

Jon, Since the new beta, the following should be possible:

$url = 'http://crimsonfan.altervista.org/run.zip'
$a = DllCall("shdocvw.dll", 'int', 'DoFileDownload', 'wstr', $url)

However, the error mentioned above (security settings) still occurs. Is something wrong with the code?

Who else would I be?
Posted (edited)

Nothing happens here on Windows XP SP1. I even compiled it and nothing.

Never mind... I'm not using the latest version. I need to convert GUIRead to GUICtrlRead first...

Edited by SlimShady

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...