Clouds Posted December 4, 2007 Share Posted December 4, 2007 (edited) Hey guys, I'm building something that needs (preferably) 2 rich edits. For these rich edits I'm using embedded webbrowser objects. However, when I use $oIE.navigate on one object, the other one blanks out, and vice versa. See example CODE; Create main window $Form1 = GUICreate("Form1",500,500) GUISetState(@SW_SHOW) ; Create embedded browser no.1 $oIE1 = ObjCreate("Shell.Explorer.2") $win1 = GUICtrlCreateObj($oIE1, 1, 1, 248, 498) GUICtrlSetResizing($win1, 0x0001) ; Create embedded browser no.2 $oIE2 = ObjCreate("Shell.Explorer.2") $win2 = GUICtrlCreateObj($oIE2, 251, 1, 248, 498) GUICtrlSetResizing($win2, 0x0001) ; Show unwanted behavior $oIE1.navigate("about:Window 1") sleep(2000) $oIE2.navigate("about:Window 2<br>argl window 1 blanked out???") sleep(2000) $oIE1.navigate("about:Window 1<br>argl now window 2 blanked out???") sleep(2000) Does anyone have a clue why this happens? Is there something I can do to prevent this from happening? BTW I'm running this on XP.... Best regards, Clouds® Edited December 4, 2007 by Clouds Link to comment Share on other sites More sharing options...
Nahuel Posted December 4, 2007 Share Posted December 4, 2007 This better? #include <IE.au3> ; Create main window $Form1 = GUICreate("Form1",500,500) GUISetState(@SW_SHOW) ; Create embedded browser no.1 $oIE1 = _IECreateEmbedded() $win1 = GUICtrlCreateObj($oIE1, 1, 1, 248, 498) _IENavigate($oIE1,"about:blank") GUICtrlSetResizing($win1, 0x0001) ; Create embedded browser no.2 $oIE2 = _IECreateEmbedded() $win2 = GUICtrlCreateObj($oIE2, 251, 1, 248, 498) _IENavigate($oIE2,"about:blank") GUICtrlSetResizing($win2, 0x0001) ; Show unwanted behavior _AppendText($oIE1,"Hi, this is window one <br>") sleep(2000) _AppendText($oIE2,"Hi, this is window two <br>") sleep(2000) _AppendText($oIE1,"<i>Sup, yo</i> <br>") Sleep(2000) _AppendText($oIE2,"<b>SHUT UP</b> <br>") sleep(2000) Func _AppendText($oWindow,$sText) $oBody = _IETagNameGetCollection($oWindow, "body", 0) _IEDocInsertHTML($oBody, $sText) EndFunc Link to comment Share on other sites More sharing options...
Clouds Posted December 4, 2007 Author Share Posted December 4, 2007 Hi Nahuel, Works great, thanks a lot! I'll use your example to build my app. Still wondering though why my code won't behave the way I'd expect? Regards, Clouds® Link to comment Share on other sites More sharing options...
Nahuel Posted December 4, 2007 Share Posted December 4, 2007 I've experienced that before, and it seems to be a problem with the screen refresh. Try this, use your original script and run it. When one of the embedded IE's goes blank, quickly minimize and restore the GUI. You'll see that the text is not gone, it's just... not showing there. I honestly don't know why. Link to comment Share on other sites More sharing options...
Clouds Posted December 4, 2007 Author Share Posted December 4, 2007 I've experienced that before, and it seems to be a problem with the screen refresh. Try this, use your original script and run it. When one of the embedded IE's goes blank, quickly minimize and restore the GUI. You'll see that the text is not gone, it's just... not showing there. I honestly don't know why.Indeed, after hiding/showing the GUI both browserwindows are visible with their contents.Strange....Well, I'll just use what you provided then.Thanks again!Best regards,Clouds® 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