Hello,
I currently have a Gui with download links, that will download files and show an external box with the progress. I have updated the GUI with a progress control built-in, and would like to have the download progress show there instead. I have included the current code, as well as an image of the current progress bar.
The built-in gui is set to 100 for ease in locating.
Thanks in advance,
Sonny
$mnuCCleaner = GUICtrlCreateMenuitem("CCleaner", $mnuDownloads) ;button to click
Case $msg = $mnuCCleaner
$url = "http://download.piriform.com/ccsetup302.exe"
_downloadSplash($url)
Func _downloadSplash($url, $open = 1) ;
Dim $dims, $software, $size
;get down of package from url
$software = StringSplit($url, "/")
$dims = UBound($software)
$dims = $dims - 1
;get size
$size = InetGetSize($url)
;download package
InetGet($url, @DesktopDir & "" & $software[$dims], 1, 1)
ProgressOn ("Download Progress", "Downloading " & $software[$dims], "",-1,-1,BitOr(2, 16))
While @InetGetActive
$currentsspercent = (100 * @InetGetBytesRead) / $size
ProgressSet($currentsspercent, "Please Wait ... Bytes: " & @InetGetBytesRead)
Sleep(250)
Wend
ProgressSet(100 , "Done", "Download Complete")
sleep(500)
ProgressOff()
If $open = 1 Then
Run(@DesktopDir & "" & $software[$dims])
Else
MsgBox(0, "Finished", "Your download has finished and " & @CRLF & "is on the current desktop." & @CRLF & @CRLF & @InetGetBytesRead & " bytes total")
EndIf
EndFunc