Sign in to follow this  
Followers 0
4b0082

Another Stupid IE Question: Open in Background?

6 posts in this topic

#1 ·  Posted (edited)

I have two version of a script opening IE to load data, then closing - script 'a' opens IE in the background without dragging the application to the front and disrupting activity (scrolling, typing, etc.) - script 'b' opens IE in the foreground and disrupts activity.

Why is script 'a' functioning differently than 'b'? Is there a way I can dictate that the script opens IE in the background so it won't interfere with whatever I'm doing while my program runs in the background?

I've also tried replacing _IEQuit with ProcessClose("iexplore.exe") and it doesn't make a difference. Both these scripts would start at the same location in the main code, so I'm not sure why _IECreate is behaving so differently.

Sorry ahead of time SmOke_N if this is related to the problem you mentioned in another thread.  :sweating: 

Edit: Also, setting $iTakeFocus to 0 doesn't change anything.

Script A:

For $cPage = 0 to $tPage-1 ; -- Opens and closes 5 IE, one at a time.
   $oIE = _IECreate($url[$cPage], 0, 0)
   Sleep(2000)
   _IEQuit($oIE)
Next

Script B:

$oIE = _IECreate($url[0], 0, 0) ; -- Opens the first tab.

   For $cPage = 1 to $tPage-1 ; -- Opening 4 additional tabs.
      Sleep(2000)
      $oIE.Navigate($url[$cPage], 0x0800)
   Next

   For $cPage = 1 to $tPage-1 ; -- Close each tab.
   _IEQuit($tab[$cPage])
   Next
Edited by 4b0082

Share this post


Link to post
Share on other sites



In the helpfile, look at the last parameter of _IECreate


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Edit: Also, setting $iTakeFocus to 0 doesn't change anything.

Share this post


Link to post
Share on other sites

I have been able to do just this with a virtual machine running minimized. Can I ask why you want to do this in the background?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

It's monitoring the status of websites. I actually want to run this in hidden mode, but it's still interrupting my activity and I narrowed it down to the _IECreate and Navigate that's causing the problem. I still haven't found a solution; when I replace the working _IECreate with the one that's causing problems it still causes problems in the alternative script, so I'm not sure what the issue is.

It's the same links, same website, same order, so it's got to be something about the code.

Share this post


Link to post
Share on other sites

Well, I'm not sure what the problem was - but it looks like it's gone now.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0