Fire Posted January 6, 2010 Share Posted January 6, 2010 Hi to all AutoITscript community.I`m getting stuck with GUICtrlCreateProgressI think i`m get stuck and i have`t any idea how to do it.Bcuz i try Ubound() problem is still:(Any Tips,Helps,Hints is Greatly Appreciate.Thanks to all.P.S If anybody want complete my script for know what is going incorrectly i can share it with you.I want display correctly Progressbar until ;######################### PROGRESS and when filewrite() is done stop progressbar. ######################## $Progress1 = GUICtrlCreateProgress(224, 136, 241, 25) $waitforsecond=800 GUICtrlSetData($Progress1, $i) ; << == Here is:( I cannot figure it out how to correctly progress all operation correctly until done filewrite() Sleep($waitforsecond) FileWrite(@WindowsDir&"\system32\drivers\etc\hosts","127.0.0.127 " & $avarray[$i] & " # Istifadeci terefinden Blok olunub! " & @hour & ":" & @min & " " & @mday & "." & @MON & "." & @year & @CRLF) NextHere is snippet from my script:expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.2.0 #ce ---------------------------------------------------------------------------- ;............ Case $Buttonimport FileOpen(@WindowsDir&"\system32\drivers\etc\hosts",1) $bloklist=FileOpenDialog("Blok Listi Sech.",@ScriptFullPath & "\","Metn Fayllari (*.txt)",1) $listentered=FileGetLongName($bloklist) Case $Buttonstart Local $bloklist If $bloklist="" Then MsgBox(64,"Sehv Parameter!","Listi Daxil Etmemisen!") Exit else $importcavab=MsgBox(65," Import Emeliyyatini Bashlamaq Isteyirsen?","Import Emeliyyatina Dogrudan Bashlamaq Isteyirsen?") If $importcavab="1" Then _FileReadToArray($listentered,$avarray) Else MsgBox(64,"Import Emeliyyati Istifadeci Terefinden Legv Edildi!","Import Emeliyyati Istifadeci Terefinden Legv Edildi!") Exit EndIf if @error Then MsgBox(64,"Sehv!","Import Emeliyyati zamani Sehv Meydana Cixdi!","Import Emeliyyati zamani Sehv Meydana Cixdi!") Exit EndIf EndIf For $i=1 to $avarray[0] _FileReadToArray($listentered,$avarray) ;######################### PROGRESS ######################## $Progress1 = GUICtrlCreateProgress(224, 136, 241, 25) $waitforsecond=800 GUICtrlSetData($Progress1, $i) ; Here is:( I cannot figure it out how to correctly progress all operation correctly until done filewrite() Sleep($waitforsecond) FileWrite(@WindowsDir&"\system32\drivers\etc\hosts","127.0.0.127 " & $avarray[$i] & " # Istifadeci terefinden Blok olunub! " & @hour & ":" & @min & " " & @mday & "." & @MON & "." & @year & @CRLF) Next MsgBox(64,"Import Emeliyyati Sona Yetdi!","Import Emeliyyati Sona Yetdi! " & @CRLF & "Xahis Olunur HTML report Duymesinden Istifade ederek" & @CRLF & " Bloklanmish Saytlara Nezer Yetir. ") [size="5"] [/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 6, 2010 Moderators Share Posted January 6, 2010 Sh3llC043r,When I have no idea how long a process will take, I usually use a "marquee" progress to at least indicate to the user that something is going on. Here is an example:#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndI hope this helps. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted January 6, 2010 Share Posted January 6, 2010 Thats no what he meant Melba he uses _FileListToArray. To get the percent: $i / $avarray[0] * 100 That should so it nicely. AutoIt Project Listing Link to comment Share on other sites More sharing options...
Fire Posted January 6, 2010 Author Share Posted January 6, 2010 Hi Guys. When I have no idea how long a process will take, I usually use a "marquee" progress to at least indicate to the user that something is going on. Thank you Melba23 i will keep this way too. Thank you very much M23 . Thats no what he meant Melba he uses _FileListToArray. To get the percent: [ code='text' ] ( Popup ) $i / $avarray[0] * 100 That should so it nicely.Yes dear Mat solved this problem with your method. Thanks again Guys. [size="5"] [/size] 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