trandatnh Posted February 10, 2009 Share Posted February 10, 2009 _IECreate() , _IENavigate() and some _IE* functions have _IELoadWait option. _IELoadWait so good but I'm having problem with it. I don't want to wait for image load. question: how can I use _IELoadWait functions (in _IECreate(), _IENavigate()) and don't need to wait image load? thanks. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 10, 2009 Share Posted February 10, 2009 _IECreate() , _IENavigate() and some _IE* functions have _IELoadWait option. _IELoadWait so good but I'm having problem with it. I don't want to wait for image load.question: how can I use _IELoadWait functions (in _IECreate(), _IENavigate()) and don't need to wait image load?thanks. Dog ate your help file? Look at the $f_wait parameter for those functions in the help file. 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 Link to comment Share on other sites More sharing options...
trandatnh Posted February 10, 2009 Author Share Posted February 10, 2009 maybe u don't understand my question. I read about $f_wait but if set $f_wait = 1 ~> wait for load image if set $i_wait = 0 ~> no wait anything, ~> sometime the source of site is nothing too. I'm talking about the option, if set $f_wait = -1 then ~> wait load source but dont wait load image? p/s:what do u mean, "Dog ate your help file" >"<? Link to comment Share on other sites More sharing options...
KaFu Posted February 10, 2009 Share Posted February 10, 2009 (edited) Hmm, if the page is standard HTML, turn wait to 0, load page, loop-read HTML-Body and if string </html> can be found continue... Edited February 10, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
trandatnh Posted February 10, 2009 Author Share Posted February 10, 2009 have not any way else? Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 10, 2009 Share Posted February 10, 2009 maybe u don't understand my question. I read about $f_wait but if set $f_wait = 1 ~> wait for load imageExactly.if set $i_wait = 0 ~> no wait anything, ~> sometime the source of site is nothing too.I don't understand what you mean here.I'm talking about the option, if set $f_wait = -1 then ~> wait load source but dont wait load image?Where did you see an option for $f_wait = -1? That will be exactly the same as $f_wait = 1 (both True, wait for page to finish).Dale Hohm did post a solution somewhere for turning images off when loading the page. I don't remember how it worked, but if you use the Search function, you should be able to find it.p/s:what do u mean, "Dog ate your help file" >"<?It was meant to be funny by reference to "My dog ate my homework." 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 Link to comment Share on other sites More sharing options...
DaleHohm Posted February 10, 2009 Share Posted February 10, 2009 There is another way... turn off the wait in _IECreate and then monitor the readystate yourself with _IEPropertyGet(object, "readystate") Object can be the browser object (e.g. $oIE), document (e.g. $oDoc = $oIE.document) or any DOM element. Readystate values unfortunately are either strings or constants, depending on the object. 0 = uninitialized 1 = loading 2 = loaded 3 = interactive 4 = complete _IELoadWait uses this property and checks for the numeric or string value. You typically will not want to continue before 3, interactive. 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...
trandatnh Posted February 12, 2009 Author Share Posted February 12, 2009 (edited) Thank Dale, and here is my way. While Not ($o_object.readyState = 3 Or $f_About) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_About = True EndIf Sleep(100) WEnd While Not (IsObj($o_object.document.body) Or $f_About) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_About = True EndIf Sleep(100) WEnd I still have problem with _IECreateNew(). I want to invisible IE instance with _IECreateNew and here is my way Local $s_random, $h_IEhandle, $o_IE Local $result, $f_mustUnlock = 0 $s_random = "about:blank-" & Random(1000000, 9999999, 1) Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $s_random) If Not WinWait($s_random, "", 60) Then; Expected IE window did not appear Return SetError(1, 0, 0) EndIf If Not $f_visible Then $f_takeFocus = 0; Force takeFocus to 0 for hidden window If Not $f_visible Then $result = __IELockSetForegroundWindow(1) If $result Then $f_mustUnlock = 1 EndIf ;If Not $f_visible Then WinSetTrans($s_random, '',0) $h_IEhandle = WinGetHandle($s_random, "") $o_IE = _IEAttach($h_IEhandle, "hwnd") If Not IsObj($o_IE) Then; attach failed Return SetError(2, 0, 0) EndIf $o_IE.visible = $f_visible If $f_mustUnlock Then $result = __IELockSetForegroundWindow($LSFW_UNLOCK) If Not $result Then __IEErrorNotify("Warning", "_IECreate", "", "Foreground Window Unlock Failed!") ; If the unlock doesn't work we may have created an unwanted modal window EndIf _IENavigate($o_IE, $s_url) Return $o_IE It does not work well as my expected. if i set $f_visible= 0 , IE instance will be invisible but when one IE instance is created, it will take focus of the current activate windows. And it still visible in a short time I want it don't appear, don't take focus. How to do that? thanks for read. trandatnh Edited February 12, 2009 by trandatnh Link to comment Share on other sites More sharing options...
DaleHohm Posted February 14, 2009 Share Posted February 14, 2009 You're doing everything I would suggest. IE8 appears to have a "newprocess" flag so there may be some new options comming -- but I have not tested with it yet. 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