Jump to content

Update Progress Bar


Go to solution Solved by FireFox,

Recommended Posts

Ive been trying for a couple of day to update a progress bar that i have in my gui but i just cant seem to get it working.

i am sure that this function needs more improvment also.

some lines where copied from other scripts (thank you)

here is what i have:

Func _Update()
      Local $FileSize
      Local $url = "http://downloads.sophos.com/tools/sav32sfx.exe" ;Set URL
      Local $folder = @ScriptDir & "\files\CLI\sav32sfx.exe" ;Set folder
      Local $hInet = InetGet($url, $folder, 1, 1) ;Forces a reload from the remote site and return immediately and download in the background
      While Not InetGetInfo($hInet, 2) ;Loop until download is finished
      Sleep(500) ;Sleep for half a second to avoid flicker in the progress bar
      GUICtrlSetData($lblUpdating, "Downloading CLI")
      Local $BytesReceived = InetGetInfo($hInet, 0) ;Get bytes received
      Local $Pct = Int($BytesReceived / $FileSize * 100) ;Calculate percentage
      GUICtrlSetData($Progress1, $Pct & "%") ;Trys to update progress bar   
      WEnd
      GUICtrlSetData($lblUpdating, "")
   EndFunc

thanks in advance.

Link to comment
Share on other sites

Division by zero?  Edano, you must be almost as old as I am!  The younger, digital crowd don't understand we analogs, and they have never heard of division by zero errors.  All that's ok, they have black and white (digital, binary), we have all the colors of the rainbow (analog)!

Meds.  They're not just for breakfast anymore. :'(

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...