Sonny Posted January 17, 2011 Share Posted January 17, 2011 (edited) 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 Edited June 23, 2014 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 More sharing options...
Zedna Posted January 18, 2011 Share Posted January 18, 2011 What's wrong with your helpfile ;-) ? GUICtrlCreateProgress GUICtrlSetData Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Sonny Posted January 18, 2011 Author Share Posted January 18, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now