Post by garry » 01 Apr 2014, 14:46
have no solution to this example
another example , downloadtofile with progressbar
Code: Select all
;- example downloads Autohotkey (ahk-install.exe)
;-------- saved at Donnerstag, 25. April 2013 18:59:42 user DataLife --------------
;-------- http://www.autohotkey.com/board/topic/17915-urldownloadtofile-progress/page-4 ---
surl:="http://www.auto-hotkey.com/download/ahk-install.exe"
;surl:="http://www.oocities.com/KindlyRat/GWBASIC.EXE.zip"
SplitPath, surl, name, dir, ext, name_no_ext, drive
sFile=%a_desktop%\%name%
ifexist,%sFile%
filedelete,%sFile%
;-----------------------------------------------
a:=a_tickcount
Progress, % "M W" . A_ScreenWidth//2, 0, 0 of 0
VarSetCapacity(vt, 4*11), nParam = 31132253353
Loop, Parse, nParam
NumPut(RegisterCallback("DownloadProgress", "Fast", A_LoopField, A_Index-1), vt, 4*(A_Index-1))
DllCall("urlmon\URLDownloadToFileA", "Uint", 0, "str", sUrl, "str", sFile, "Uint", 0, "UintP", &vt)
delta:=((a_tickcount-a)/1000)
msgbox, 262208,Downloaded ,Downloaded`n%name% to Desktop`n in %delta% seconds
exitapp
return
DownloadProgress(pthis, nProgress = 0, nProgressMax = 0, nStatusCode = 0, pStatusText = 0)
{
If A_EventInfo = 6
Progress, % p := 100 * nProgress//nProgressMax, %p%, % nProgress . " of " . nProgressMax
Return 0
}
return
;----------------------------------
esc::exitapp
have no solution to this example
another example , downloadtofile with progressbar
[code=autohotkey file=Script.ahk];- example downloads Autohotkey (ahk-install.exe)
;-------- saved at Donnerstag, 25. April 2013 18:59:42 user DataLife --------------
;-------- http://www.autohotkey.com/board/topic/17915-urldownloadtofile-progress/page-4 ---
surl:="http://www.auto-hotkey.com/download/ahk-install.exe"
;surl:="http://www.oocities.com/KindlyRat/GWBASIC.EXE.zip"
SplitPath, surl, name, dir, ext, name_no_ext, drive
sFile=%a_desktop%\%name%
ifexist,%sFile%
filedelete,%sFile%
;-----------------------------------------------
a:=a_tickcount
Progress, % "M W" . A_ScreenWidth//2, 0, 0 of 0
VarSetCapacity(vt, 4*11), nParam = 31132253353
Loop, Parse, nParam
NumPut(RegisterCallback("DownloadProgress", "Fast", A_LoopField, A_Index-1), vt, 4*(A_Index-1))
DllCall("urlmon\URLDownloadToFileA", "Uint", 0, "str", sUrl, "str", sFile, "Uint", 0, "UintP", &vt)
delta:=((a_tickcount-a)/1000)
msgbox, 262208,Downloaded ,Downloaded`n%name% to Desktop`n in %delta% seconds
exitapp
return
DownloadProgress(pthis, nProgress = 0, nProgressMax = 0, nStatusCode = 0, pStatusText = 0)
{
If A_EventInfo = 6
Progress, % p := 100 * nProgress//nProgressMax, %p%, % nProgress . " of " . nProgressMax
Return 0
}
return
;----------------------------------
esc::exitapp
[/code]