No of visitors who read this post: 322
Type: Question
No votes yet

I would like to have a GUI that has 4 overlapping embedded IEs. The 4 IEs should be doing simultaneous clicks and keystrokes. Please let me know if it is possible. If so, what are the codes?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

This is actually possible but the question is what you have to do with it? It does not have any useful feature in the real life. There are a lot scenarios in which this thing sounds important but overall its of no use. However if you only want to have a demonstration, then you can see the following code.

#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)
; This is the code where your keystrokes and clicks will be transferred as parameters
 
; After that you can also send the automated data too for some specific actions
 
; Actually the code that I have mentioned works only one at a time but you can do things with object 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