#include "UIAutomate.au3"
#include <WindowsConstants.au3>
Global $ScanDelay = 1000 ; частота опроса
Global $HighlightDelay = 300 ; продолжительность подсветки
Global $OldName, $NewName, $OldValue, $NewValue
While 1
$oLink = 0
$oElement = _UIA_GetElementFromPoint(MouseGetPos(0), MouseGetPos(1))
If _UIA_ElementGetPropertyValue($oElement, "ControlType") = $UIA_HyperlinkControlTypeId Then
$oLink = $oElement
Else
$oParent = _UIA_ElementGetParent($oElement)
If _UIA_ElementGetPropertyValue($oParent, "ControlType") = $UIA_HyperlinkControlTypeId Then
$oLink = $oParent
Else
$oGrandParent = _UIA_ElementGetParent($oParent)
If _UIA_ElementGetPropertyValue($oGrandParent, "ControlType") = $UIA_HyperlinkControlTypeId Then
$oLink = $oGrandParent
EndIf
EndIf
EndIf
If IsObj($oLink) Then
$NewName = _UIA_ElementGetPropertyValue($oLink, "Name")
$NewValue = _UIA_ElementGetPropertyValue($oLink, "ValueValue")
If $NewName <> $OldName Or $NewValue <> $OldValue Then
ConsoleWrite($NewName & " - " & $NewValue & @CRLF)
ClipPut($NewValue)
$OldName = $NewName
$OldValue = $NewValue
$Rect = _UIA_ElementGetBoundingRectangle($oLink)
$GUI = GUICreate("", $Rect[2] - $Rect[0], $Rect[3] - $Rect[1], $Rect[0], $Rect[1], $WS_POPUP, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
GUISetBkColor(0xFF0000)
GUISetState(@SW_SHOWNOACTIVATE)
WinSetTrans($GUI, "", 128)
Sleep($HighlightDelay)
GUIDelete()
EndIf
EndIf
Sleep($ScanDelay)
WEnd