DW1 Posted July 26, 2007 Share Posted July 26, 2007 when using _IEAction either forward or back, I get an error if there is no page to goto. In other words, if you open a new embedded browser control, and have it start at www.google.com and send the _IEAction( $oIE, "forward" ) command, my script will crash (there is no page to go to, as I am at the furthest page in the history) Is there a way to view the forward and back list of pages? Or anything that solves this issue? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DaleHohm Posted July 26, 2007 Share Posted July 26, 2007 Take a look at the example in the helpfile for _IECreateEmbedded -- it does EXACTLY what you are trying to do. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
DW1 Posted July 26, 2007 Author Share Posted July 26, 2007 OMG... LOL thanks I was missing this: _IEErrorHandlerRegister () AutoIt3 Online Help Link to comment Share on other sites More sharing options...
mikehunt114 Posted July 26, 2007 Share Posted July 26, 2007 Hi Dale, I was looking at this situation and was wondering if there's a reason you couldn't include a trap for this in _IEAction. The CommandStateChange event could alert you of the enabled/disabled state of the forward or backward actions. A switch on the command value and whether it changed the forward or backward parameter value, along with an "If enabled" statement should trap this, no? Just so you get where I'm coming from: Global Const $CSC_UPDATECOMMANDS = 0xFFFFFFFF Global Const $CSC_NAVIGATEFORWARD = 0x00000001 Global Const $CSC_NAVIGATEBACK = 0x00000002 $oSinkObject = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents") Func IEEvent_CommandStateChange($command, $enable) Switch $command Case $CSC_NAVIGATEFORWARD If $enable = True Then $allowForward = True Else $allowForward = False EndIf Case $CSC_NAVIGATEBACK If $enable = True Then $allowBack = True Else $allowBack = False EndIf EndSwitch EndFuncoÝ÷ Ù8^)È-ò¢èî²ÙÞyÖ§jëh×6If $allowForward Then ;appropriate code here Else SetError(1) EndIf I realize it can be dealt with every easily by adding _IEErrorHandlerRegister() to your script, but for completeness' sake, could a trap in _IEAction be a better solution? IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
DaleHohm Posted July 26, 2007 Share Posted July 26, 2007 Hi Dale, I was looking at this situation and was wondering if there's a reason you couldn't include a trap for this in _IEAction.Yes, housekeeping. Those event procedures are associated to a specific IE instance... you can create any number of IE instances in a particular session... when would I release one? When might I try to reuse one? So, if you want to do this sort of thing it is left to you in your script. The only event traps I deal with are AutoIt.Error and even that is very complex...Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble 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