Jump to content

Hide IE browser forever


Recommended Posts

Hello,

I have a script, its working well.

When I start running the script the random website is loading and then the browser is hiding. (That's OK for me.)

Then the script is sleeping for a random time. (That's OK for me.)

 

My problem is:

After the next website is loading, then the browser is visible again. I can see the browser for a few moments. (until the website is finish the loading.)

 

My question is:

How can I solve this problem? (Hide IE browser forever :))

 

Code:

                        Global $var[4]
                        $var[1] = "http://google.com"
                        $var[2] = "http://google.com"
                        $var[3] = "http://google.com"
                        $x = Random(1, 3, 1)
                        ShellExecute($var[$x])
                        Local $hWnd = WinWait("[CLASS:IEFrame]", "Google", 10)
                        WinSetState($hWnd, "", @SW_HIDE)
                        Sleep(Random(5000, 8000, 1))

                      Global $var[4]
                        $var[1] = "http://google.com"
                        $var[2] = "http://google.com"
                        $var[3] = "http://google.com"
                        $x = Random(1, 3, 1)
                        ShellExecute($var[$x])
                        Local $hWnd = WinWait("[CLASS:IEFrame]", "Google", 10)
                        WinSetState($hWnd, "", @SW_HIDE)
                        Sleep(Random(5000, 8000, 1))

 

Thanks for  helping!

 

Link to comment
Share on other sites

You could use the IE functions in the IE.au3 UDF.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

hi, to test the script and see what happens set $iVisible  = 1, to hide just set it to 0, if you want it to loop then enable the disabled 'while 1' and 'wend' or use any other loop methods like 'do until', or 'for to next'

#include <IE.au3>

$iTryAttach = 0
$iVisible  = 0
$iWait  = 1
$iTakeFocus  = 0

;create a new hidden iexplore window because of $iVisible=0
$oIE  = _IECreate("about:blank",$iTryAttach,$iVisible,$iWait,$iTakeFocus)


;~ while 1
    Global $var[4]
    $var[1] = "http://google.com"
    $var[2] = "http://google.com"
    $var[3] = "http://google.com"
    $x = Random(1, 3, 1)

    ;navegate to one of the random urls
    _IENavigate($oIE,$var[$x],$iWait) ;----> ShellExecute($var[$x]) not needed because _IENavigate navegates to your targed url
    ;Local $hWnd = WinWait("[CLASS:IEFrame]", "Google", 10) ;----> no need for this, because _IENavigate's $iWait is active and it will wait to completly load before it continue
    ;WinSetState($hWnd, "", @SW_HIDE) ;---->  no need for this because _IENavigate wont unhide, _IECreate already disable visiility with $iVisible=0
    Sleep(Random(5000, 8000, 1))
;~ WEnd

;quit explorer window after done
_IEQuit($oIE)

 

Link to comment
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
 Share

×
×
  • Create New...