Another version:

.DownloadFile(sUrl, sFile, bFlag)

If the optional bFlag is 1, use silent download function.
And, sFile, optional too, should be the path of the file, not folder,
in this case.

For example,

.DownloadFile(?"http://powerpro.webeddie.com/download/ppro4605.zip";)
or
.DownloadFile(?"http://powerpro.webeddie.com/download/ppro4605.zip";;+
,?"C:\Downloads\powerpro.zip")
or
.DownloadFile(?"http://powerpro.webeddie.com/download/ppro4605.zip";;+
,?"C:\Downloads\powerpro.zip",1)

--------------------- DownloadFile.PowerPro --------------------------
Function DownloadFile(sUrl,sFile,bFlag)

if(bFlag)do
dll.call("urlmon|URLDownloadToFileA|ui s+ s+ ui ui";;+
,0,"sUrl","sFile",0x10,0)

else
local xUrl
dll.call("MultiByteToWideChar|ui ui s+ i s+ i";;+
,0,0,"sUrl",-1,"xUrl",272/2)

dll.call("shdocvw|DoFileDownload|s+","xUrl")

wait.for(anywindow    "FileDialog,&,=PowerPro")
local hWnd=win.handle("FileDialog,&,=PowerPro")

if(sFile)
hWnd.ChildHandlelist("c=edit").SetText(sFile)
hWnd.ChildHandlelist("c=button").Word(2).PostMessage(0xF5)
endif
----------------------------------------------------------------------

Sean

Reply via email to