trandatnh Posted February 6, 2009 Share Posted February 6, 2009 (edited) I'm not good about web programming and connections from client to sever. Now, I'm having a problem when use _IECreate function. I'm playing a webgame, and this game can be play in multi mode. It mean I can open and sign in more than one ID at the time! But, I can't do that with _IECreate. an example: I signed in an ID(id1), open a new IE by myself (click on IE icon ), Navigate to webgame site, sign in(id2) ~> ok, I play 2 ID at the time. id1 and id2 I signed in an ID(id1), use _IECreate to open a new IE, Navigate to webgame site ~> I cant sign in, cuz this IE contain previous ID(id1). I was compelled to sign out for sign in new account Can someone explain for me why? And how to overcome this problem? Edited February 6, 2009 by trandatnh Link to comment Share on other sites More sharing options...
DaleHohm Posted February 6, 2009 Share Posted February 6, 2009 A single iexplore.exe can control many browser instances. Cookies/Session State is shared accross all browsers running out of the same process. Here is how I force the creation of a new browser process when I need one: #include <IE.au3> $oIE = _IECreateNew("www.autoitscript.com") Func _IECreateNew($s_url = "about:blank") ; Create an IE browser in a new process, attach to it and navigate to spcified URL ; Returns browser object on success ; Returns 0 on failure and sets @error to 1 (timeout waiting for browser) or 2 (attach failed) Local $s_random, $h_IEhandle, $o_IE $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 $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 _IENavigate($o_IE, $s_url) Return $o_IE EndFunc My routine for this used to be a lot more complex until I found the trick of using a random string with about:blank 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 6, 2009 Author Share Posted February 6, 2009 (edited) Thank Dale for your reply and your IE.au3 lib. I tried to use it. And it works so good. Hope I don't disturb to you, but I still have some question and my English is not good enough to read and understand all of Autoit Help file. My problem is After I click a button, a pop-up appear. Question: how can I control that pop-up? thank Dale again! Edited February 7, 2009 by trandatnh Link to comment Share on other sites More sharing options...
Authenticity Posted February 6, 2009 Share Posted February 6, 2009 Using the Win* or Control* functions, what is the pop-up window? IE's or a plain one? Link to comment Share on other sites More sharing options...
trandatnh Posted February 6, 2009 Author Share Posted February 6, 2009 That is IE's pop-up Here is code of button <button id="i167" name=":submit" value="出兵" onclick="var wcall=wicketSubmitFormById('actionForm', '?x=Goyqg*H6M3WGHkeSG*WX5fInhnwvtVVKiL75z-DSWNxjD0HmgKj-ga*N9dSoSBLKyoHhVa3UfdfFHnlWJsiWo407qVkhikLpPjkBeYHCbyN*SOhulP77QK*uqYyRUJIj', ':submit' ,null,null, function() {return Wicket.$$(this)&&Wicket.$$('actionForm')}.bind(this));;; return false;" type="button"> Click Me </button> And here is code op the pop-up appear after click above button <form id="cf" action="?x=9Fnh2bYmXJm9Cas-KScUK98DxMEYDNT4Q0JbMBuWFnQ5HjnaSkvgLxDriChuMRwW" target="_parent" method="post"><div style="display:none"><input type="hidden" name="cf_hf_0" id="cf_hf_0" /> Can you give me an example? Link to comment Share on other sites More sharing options...
Authenticity Posted February 6, 2009 Share Posted February 6, 2009 (edited) I could but I don't know what is the title for example, or it's completely unnecessary... It's probably can be managed by some _IE* functions like _IEGetObjById() if applicable. Depend on the case.... The examples are all there in the help file. Edited February 6, 2009 by Authenticity Link to comment Share on other sites More sharing options...
trandatnh Posted February 6, 2009 Author Share Posted February 6, 2009 I could but I don't know what is the title for example, or it's completely unnecessary... It's probably can be managed by some _IE* functions like _IEGetObjById() if applicable. Depend on the case.... The examples are all there in the help file.In this case can't use _IE* functions, cuz I don't have "Object variable of an InternetExplorer.Application". =.="another way? Link to comment Share on other sites More sharing options...
DaleHohm Posted February 7, 2009 Share Posted February 7, 2009 In this case can't use _IE* functions, cuz I don't have "Object variable of an InternetExplorer.Application". =.="another way?Please see _IEAttach with the "dialogbox" parameter.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 7, 2009 Author Share Posted February 7, 2009 I will read in Autoit Help file about _IEAttach for more information thank Dale! Link to comment Share on other sites More sharing options...
trandatnh Posted February 7, 2009 Author Share Posted February 7, 2009 I still have some problem with IE.au3 When I use _IECreate or _IENavigate I have to wait for _IELoadwait finished. It took so much time (because IE load image). What can I use function to overcome this problem? Link to comment Share on other sites More sharing options...
Authenticity Posted February 7, 2009 Share Posted February 7, 2009 heh, so don't wait. Give the function's proper $fWait parameter 0 and sleep the amount time you wish and use _IEAction($oIE, 'stop') to stop loading the images. Link to comment Share on other sites More sharing options...
trandatnh Posted February 7, 2009 Author Share Posted February 7, 2009 (edited) ^^! That way cant be use :| how much for time sleep? if we set time is not enough ~> error if we set time is so much ~> loadwait better than. (*I often or always write with wrong grammar, can u or every one help me to improve E writing skill ?(:cry:)*) Edited February 7, 2009 by trandatnh 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