Aston1X Posted May 22, 2010 Share Posted May 22, 2010 (edited) Well, I'm trying to get the browser in my GUI to navigate but I keep getting an error, here's my code as it is expandcollapse popup#include <IE.au3> #include <GUIConstants.au3> $hwnd = GUICreate ("Web Browser", 1100, 700) GUISetFont(9, 400, -1, "comic sans") GUISetState() $B_oIE1 = ObjCreate("Shell.Explorer.2") $Breaktime = GUICtrlCreateObj($B_oIE1, -1, -1, 1000, 700) $BrkStart = GUICtrlCreateButton("&Start", 1010, 45, 80, 25) $BrkPause = GUICtrlCreateButton ("&Pause", 1010, 80, 80, 25) $BrkEnd = GUICtrlCreateButton("&Exit", 1010, 115, 80, 25) $B_oIE1.navigate ("http://google.com") HotKeySet("{ESC}", "Close") HotKeySet("{F3}", "About") ; Still working on these... While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then Exit EndIf If $msg = $BrkPause Then Sleep (10000) EndIf If $msg = $BrkStart And IsObj($B_oIE1) Then SBsearch() $B_oIE3.navigate ("http://google.com") _Func SBsearch() Endif WEnd Func Close() $hwnd = GUICreate ("About", 300, 100) GUISetFont(9, 400, -1, "comic sans") GUISetState() $B_oIE1 = ObjCreate("Shell.Explorer.2") $Breaktime = GUICtrlCreateObj($B_oIE1, -1, -1, 300, 100) $BrkStart = GUICtrlCreateButton("&Yes", 50, 50, 80, 25) $BrkEnd = GUICtrlCreateButton ("&No", 150, 50, 80, 25) $html = ("about: <center> Are you sure you wish to exit?</center>") $B_oIE1.navigate ( $html) EndFunc Func SBsearch() $Search = "HackForums" $oForm = _IEFormGetObjByName($oIE, "search") - I get an error about this line. Variable being used without declaration. $oQuery = _IEFormElementGetObjByName($oForm, "q") _IEFormElementSetValue($oQuery, $Search) _IEFormSubmit($oForm) _IELoadWait($oNavigate) EndFunc Much help appreciated. Edited May 23, 2010 by Aston1X Link to comment Share on other sites More sharing options...
JohnOne Posted May 23, 2010 Share Posted May 23, 2010 As far as I can see at this hour, you dont have $oIE anywhere other than the error line. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Aston1X Posted May 23, 2010 Author Share Posted May 23, 2010 so I put Dim $oIE in the func and it's sorted that out but now it's complaining about an error parsing func call for _func SBsearch() If $msg = $BrkStart And IsObj($B_oIE1) Then SBsearch() _Func SBsearch() Endif Link to comment Share on other sites More sharing options...
Makaule Posted May 23, 2010 Share Posted May 23, 2010 (edited) just delete _Func SBsearch(), as you have called SBsearch() before and i even dont know why you have added that line, as i cant even imagine what should do _Func something(). Edited May 23, 2010 by Makaule 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