Sign in to follow this  
Followers 0
wolle7

new instance of iexplore.exe which may be started language independant

6 posts in this topic

Hi,

in the help file is this example here:

; *******************************************************
; Example 6 - Create a browser window attached to a new instance of iexplore.exe
;              This is often necessary in order to get a new session cookie context
;              (session cookies are shared among all browser instances sharing the same iexplore.exe)
; *******************************************************
;
#include <IE.au3>
ShellExecute ("iexplore.exe", "about:blank")
WinWait ("Blank Page")
$oIE = _IEAttach ("about:blank", "url")
_IELoadWait ($oIE)
_IENavigate ($oIE, "www.autoitscript.com")

Great that's exactly what I'm looking for, but on a German computer I need WinWait ("Leere Seite") has someone an idea how to do this language independant but with the same background of the new session cookie context. It would be enough tho replace that line with an other wait command, but not just a timeloop with sleep.

Cheers Wolle


Cheers Wolle

Share this post


Link to post
Share on other sites



Some alternatives:

#include <IE.au3>
$oIE = _IECreate()
_IENavigate ($oIE, "www.autoitscript.com")oÝ÷ ØêÚºÚ"µÍÚ[ÛYH  ÒQK]LÉÝÂÚ[^XÝ]H
    ][ÝÚY^ÜK^I][ÝË ][ÝØXÝ][É][ÝÊBÚ[ØZ]
    ][ÝÖÐÓTÔÎQQ[YWI][ÝÊBÛY
L
BÌÍÛÒQHHÒQP]XÚ
    ][ÝØXÝ][É][ÝË ][ÝÝ  ][ÝÊBÒQSØYØZ]
    ÌÍÛÒQJBÒQS]YØ]H
    ÌÍÛÒQK  ][ÝÝÝÝË]]Ú]ØÜÛÛI][ÝÊ

In the help file, read:

Window Titles and Text (Basic)

Window Titles and Text (Advanced)

Share this post


Link to post
Share on other sites

Hi Manadar,

your first solution is a problem because of the mentioned cookie context.

The secon is that what I'm looking for. I've read a little bit about the WinWait ("[CLASS:IEFrame]"). What happens if a second instance of IE is already running ? Does this not affect all IEs or only the new instance ?

Cheers Wolle


Cheers Wolle

Share this post


Link to post
Share on other sites

Figured it out. There is a problem that iexplore.exe can have more than one window, but does not always have.

What this code does is:

1) Finds a list of window handles

2) Uses only the window handles that are attached to the newly started iexplore.exe

3) Tries to attach to the IE window, using a window handle.

Succesful: Continue normal program code

Failure: Go to 1)

#include <IE.au3>

Dim $oIE = 0, $iPID = 0

$iPID = Run("C:\Program Files\Internet Explorer\iexplore.exe about:blank")

While 1
    $Windowlist = WinList()
    For $i = 1 to $Windowlist[0][0]
        If WinGetProcess($Windowlist[$i][1]) = $iPID Then
            $oIE = _IEAttach ($Windowlist[$i][1], "HWND")
            If ( IsObj($oIE) ) Then
                ExitLoop 2
            EndIf
        EndIf
    Next
    Sleep(100)
WEnd

;; $oIE is guaranteed to be correct here
_IELoadWait ($oIE)
_IENavigate ($oIE, "www.autoitscript.com")

Share this post


Link to post
Share on other sites

Thank you very much :P That seems to make sense. Great :unsure:


Cheers Wolle

Share this post


Link to post
Share on other sites

I just tested it, but I had no success. I don't know why but I never run into the 'then condition' of "If WinGetProcess($Windowlist[$i][1]) = $iPID Then"

Any ideas why ?


Cheers Wolle

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