N340 Posted June 22, 2008 Posted June 22, 2008 Hi, I'm trying to make an IE based web browser. I have managed the main things, forward, back button etc... But now I want to make a progress bar, and failed CODE$GUI_Progress=GUICtrlCreateProgress(835, 632, 120, 15) $wait = 20; wait 20ms for next progressstep $s = 0; progressbar-saveposition Do $msg = GUIGetMsg() If $msg = $GUI_GO Then GUICtrlSetData($GUI_GO, "Go") For $i = $s To 100 $m = GUIGetMsg() If $m = -3 Then ExitLoop If $m = $GUI_GO Then GUICtrlSetData($GUI_GO, "Go") $s = $i;save the current bar-position to $s ExitLoop Else $s = 0 GUICtrlSetData($GUI_Progress, $i) EndIf Next If $i > 100 Then ; $s=0 GUICtrlSetData($GUI_GO, "Go") EndIf EndIf Until $msg = $GUI_EVENT_CLOSE Could someone help me, the progress bar doesn't work when I have entered the web address and clicked on "Go" It just stays the same as the web page loads. I want the progress bar to move in accordance to how much the web page has loaded. Thanks, NS340
PsaltyDS Posted June 22, 2008 Posted June 22, 2008 Hi, I'm trying to make an IE based web browser. I have managed the main things, forward, back button etc... But now I want to make a progress bar, and failed CODE$GUI_Progress = GUICtrlCreateProgress(835, 632, 120, 15) $wait = 20 ; wait 20ms for next progressstep $s = 0 ; progressbar-saveposition Do $msg = GUIGetMsg() If $msg = $GUI_GO Then GUICtrlSetData($GUI_GO, "Go") For $i = $s To 100 $m = GUIGetMsg() If $m = -3 Then ExitLoop If $m = $GUI_GO Then GUICtrlSetData($GUI_GO, "Go") $s = $i;save the current bar-position to $s ExitLoop Else $s = 0 GUICtrlSetData($GUI_Progress, $i) EndIf Next If $i > 100 Then ; $s=0 GUICtrlSetData($GUI_GO, "Go") EndIf EndIf Until $msg = $GUI_EVENT_CLOSE Could someone help me, the progress bar doesn't work when I have entered the web address and clicked on "Go" It just stays the same as the web page loads. I want the progress bar to move in accordance to how much the web page has loaded. Thanks, NS340 I don't understand your nested GUI message loops. What's the point of this? What triggers $GUI_GO? To help you trace it yourself, put this at the top of your script: Opt("TrayIconDebug", 1) #AutoIt3Wrapper_Run_Debug_Mode=Y Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
N340 Posted June 23, 2008 Author Posted June 23, 2008 (edited) By adding that at the top of my script I get this 0017: 0-0: $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 10, 100, 30) 0018: 0-0: $GUI_Button_Home = GUICtrlCreateButton("Home", 220, 10, 100, 30) 0019: 0-0: $GUI_Button_Stop = GUICtrlCreateButton("Stop", 320, 10, 100, 30) 0020: 0-0: $GUI_Address_Box=GUICtrlCreateInput("http://", 425, 15, 450,20) 0021: 0-0: $GUI_GO=GUICtrlCreateButton ("Go", 920,15,30,20) 0022: 0-0: $GUI_Progress=GUICtrlCreateProgress(835, 632, 120, 15) 0023: 0-0: $wait = 20; wait 20ms for next progressstep 0024: 0-0: $s = 0; progressbar-saveposition 0025: 0-0: Do 0026: 0-0: $msg = GUIGetMsg() 0027: 0-0: If $msg = $GUI_GO Then 0050: 0-0: Until $msg = $GUI_EVENT_CLOSE ***A BUNCH OF REPEATED CODE*** 0026: 0-0: $msg = GUIGetMsg() 0027: 0-0: If $msg = $GUI_GO Then 0050: 0-0: Until $msg = $GUI_EVENT_CLOSE 0053: 0-0: GUISetState();Show GUI 0055: 0-0: _IENavigate($oIE, "google.com") 0058: 0-0: While 1 0059: 0-0: $msg = GUIGetMsg() 0060: 0-0: Switch $msg 0076: 0-0: WEnd 0059: 0-0: $msg = GUIGetMsg() 0060: 0-0: Switch $msg 0076: 0-0: WEnd 0059: 0-0: $msg = GUIGetMsg() 0060: 0-0: Switch $msg 0076: 0-0: WEnd 0059: 0-0: $msg = GUIGetMsg() 0060: 0-0: Switch $msg 0062: 0-0: Exit Is that What you need? Edited June 23, 2008 by big_daddy
PsaltyDS Posted June 23, 2008 Posted June 23, 2008 By adding that at the top of my script I get thisCODE0017: 0-0: $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 10, 100, 30)0018: 0-0: $GUI_Button_Home = GUICtrlCreateButton("Home", 220, 10, 100, 30)0019: 0-0: $GUI_Button_Stop = GUICtrlCreateButton("Stop", 320, 10, 100, 30)0020: 0-0: $GUI_Address_Box=GUICtrlCreateInput("http://", 425, 15, 450,20)0021: 0-0: $GUI_GO=GUICtrlCreateButton ("Go", 920,15,30,20)0022: 0-0: $GUI_Progress=GUICtrlCreateProgress(835, 632, 120, 15)0023: 0-0: $wait = 20; wait 20ms for next progressstep0024: 0-0: $s = 0; progressbar-saveposition0025: 0-0: Do0026: 0-0: $msg = GUIGetMsg()0027: 0-0: If $msg = $GUI_GO Then0050: 0-0: Until $msg = $GUI_EVENT_CLOSE0026: 0-0: $msg = GUIGetMsg()0027: 0-0: If $msg = $GUI_GO Then0050: 0-0: Until $msg = $GUI_EVENT_CLOSE; ...0026: 0-0: $msg = GUIGetMsg()0027: 0-0: If $msg = $GUI_GO Then0050: 0-0: Until $msg = $GUI_EVENT_CLOSE0053: 0-0: GUISetState() ;Show GUI0055: 0-0: _IENavigate($oIE, "google.com")0058: 0-0: While 10059: 0-0: $msg = GUIGetMsg()0060: 0-0: Switch $msg0076: 0-0: WEnd0059: 0-0: $msg = GUIGetMsg()0060: 0-0: Switch $msg0076: 0-0: WEnd0059: 0-0: $msg = GUIGetMsg()0060: 0-0: Switch $msg0076: 0-0: WEnd0059: 0-0: $msg = GUIGetMsg()0060: 0-0: Switch $msg0062: 0-0: ExitIs that What you need?What I need...? I think what YOU need is to look at the full listing of your script and compare what you see here with what you expected to happen in your script. Use this trace of what actually happened to see where it fails. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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