This function is undocumented one, so use it at your own risk.
The usage is .DownloadFile(sUrl,sDir) where sUrl is the file to be
downloaded, and (optional) sDir is the directory where to be saved. 
E.g.,

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

-------------------- DownloadFile.PowerPro ---------------------------
Function FileDownload(sUrl,sDir)

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

if(sDir)do
local psb,pidl,xDir

dll.call("MultiByteToWideChar|ui ui s+ i s+ i";;+
,0,0,"sDir",-1,"xDir",272/2)
dll.call("shell32|SHParseDisplayName|s+ ui ui* ui ui";;+
,"xDir",0,"pidl",0,0)

wait.for(3000,activewindow "FileDialog")
psb=win.handle("FileDialog,&,=PowerPro").sendmessage(0x407)

if(psb && pidl)do
dll.call(dll.dereference(dll.dereference(psb)+4*11);;+
++"|ui ui ui",psb,pidl,0)
endif
dll.call("ole32|CoTaskMemFree|ui",pidl)
endif
----------------------------------------------------------------------

Sean

Reply via email to