;Takes in an IE browser obj, the element object to mouse to,
;an extra x pixels to move over, and an extra y pixels to move over
Func MouseToElement($oIE, $oElem, $extraX, $extraY)
local $x = _IEfindPosX($oElem)
local $y = _IEfindPosY($oElem)
$oElem.focus()
$windowleft = $oIE.document.parentwindow.screenLeft
$windowtop = $oIE.document.parentwindow.screenTop
mousemove($windowleft + $x + $extraX, $windowtop + $y + $extraY, 50)
sleep(1000)
EndFunc
func _IEfindPosX($o_object)
local $curleft = 0
local $parent = $o_object
if IsObj($parent) then
while IsObj($parent)
$curleft += $Parent.offsetLeft
$parent = $Parent.offsetParent
wend
else
local $objx = $o_object.x
if IsObj($objx) then $curleft += $objx
EndIf
return $curleft
EndFunc
func _IEfindPosY($o_object)
local $curtop = 0
local $parent = $o_object
if IsObj($parent) then
while IsObj($parent)
$curtop += $Parent.offsetTop
$parent = $Parent.offsetParent
wend
else
local $objy = $o_object.y
if IsObj($objy) then $curtop += $objy
EndIf
return $curtop
EndFunc