Jump to content

Need help switching from splash box progress bar to progress control inside the main gui


Sonny
 Share

Recommended Posts

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
post-62439-0-50749900-1295299243_thumb.j

Edited by Sonny

[font=arial, helvetica, sans-serif][quote]For every rule there's three ways around it.[/quote][/font]

Link to comment
Share on other sites

Zedna,

Surprisingly, you helped me find the answer. I guess I needed a kick-in-the-pants to get the brain juices flowing. It works great now.

Sonny

[font=arial, helvetica, sans-serif][quote]For every rule there's three ways around it.[/quote][/font]

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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