Jump to content

Script hangs with popup using _IELinkClickByIndex()


xah
 Share

Recommended Posts

The script freezes when using _IELinkClickByIndex() wich opens a popup Windows.

#include-once
#include <IE.au3>
#include <Excel.au3>
#include <_toolFunctions.au3>
objectMaken()

    $oFormContent = _IEFormGetObjByName($oFrameContent, 0)
    $productID = _ExcelReadCell ($oExcel, $Ri, 7)

    $linkIndex = kiesProduct($productID)
    _IELinkClickByIndex ($oFrameContent, $linkIndex, 0);Opens a popup and does not continue
    
    MsgBox (64, "Info", "Hallo!")
    
Func kiesProduct($productID)
    $prodLink = "https://www.epacity.nl/site/ProcessRegradeServlet?epacityProductId=" & $productID
    $oLinks = _IELinkGetCollection ($oFrameContent)
    $iNumLinks = @extended
    For $i = 0 to ($iNumLinks -1)
        $oLink = _IELinkGetCollection ($oFrameContent, $i)
        If $oLink.href = $prodLink Then
    ;_IELinkClickByIndex ($oFrameContent, $i, 0)
            Return $i
        EndIf
    Next
Return False
EndFunc

Please help?

Edited by xah
Link to comment
Share on other sites

The script freezes when using _IELinkClickByIndex() wich opens a popup Windows.

Please help?

Are you saying the link clicked does produce a popup window, but the MsgBox() doesn't come up? Since you have $f_wait = 0, that should not be blocking.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Are you saying the link clicked does produce a popup window, but the MsgBox() doesn't come up? Since you have $f_wait = 0, that should not be blocking.

:)

Exaclty! Why does it not continue ? Any ideas ?

Link to comment
Share on other sites

Exaclty! Why does it not continue ? Any ideas ?

Try giving focus to the object and then ControlClick() on it:
$hIE = _IEPropertyGet($oIE, "hwnd")
$oLink = _IELinkGetCollection($oFrameContent, $linkIndex)
_IEAction($oLink, "focus")
ControlClick($hIE, "", "")

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Try giving focus to the object and then ControlClick() on it:

$hIE = _IEPropertyGet($oIE, "hwnd")
$oLink = _IELinkGetCollection($oFrameContent, $linkIndex)
_IEAction($oLink, "focus")
ControlClick($hIE, "", "")

:)

Thanks, it works now by giving focus to the object and then ControlSend(). Edited by xah
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...