Jump to content

multiple embedded ie's


Recommended Posts

Something like this:

#include <IE.au3>

Global $oIE[5] = [4,0,0,0,0]
$oIE[1] = _IECreateEmbedded()
$oIE[2] = _IECreateEmbedded()
$oIE[3] = _IECreateEmbedded()
$oIE[4] = _IECreateEmbedded()

$hGUI = GUICreate("Example",@DesktopWidth,@DesktopHeight,0,0)
$ActiveX1 = GUICtrlCreateObj($oIE[1],0,0,@DesktopWidth/2,@DesktopHeight/2)
$ActiveX2 = GUICtrlCreateObj($oIE[2],@DesktopWidth/2,0,@DesktopWidth/2,@DesktopHeight/2)
$ActiveX3 = GUICtrlCreateObj($oIE[3],0,@DesktopHeight/2,@DesktopWidth/2,@DesktopHeight/2)
$ActiveX4 = GUICtrlCreateObj($oIE[4],@DesktopWidth/2,@DesktopHeight/2,@DesktopWidth/2,@DesktopHeight/2)
For $Index = 1 To $oIE[0]
    $oIE[$Index].Navigate("http://google.com")
    Do
        Sleep(10)
    Until Not $oIE[$Index].Busy
Next
GUISetState(@SW_SHOW,$hGUI)

; Here are just random send key and clicks
; but you can automate here your specific actions

;This work one by one but you can do actions with any object and without waiting for load
For $Index = 1 To $oIE[0]
    $oForm = _IEFormGetObjByName($oIE[$Index],"f")
    $oQuery = _IEFormElementGetObjByName($oForm,"q")
    _IEFormElementSetValue($oQuery,"Some keys")
    _IEFormSubmit($oForm)
    _IELoadWait($oIE[$Index])
    _IELinkGetCollection($oIE[$Index])
    _IELinkClickByIndex($oIE[$Index],Random(0,@extended-1,1))
Next

While True
    If GUIGetMsg() = -3 Then Exit
    Sleep(10)
WEnd

When the words fail... music speaks.

Link to comment
Share on other sites

May I ask the intended purpose of automating, say, 4 copies of a webpage?

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...