;; results: ;;############### Window handle OK Window object OK Window: ------- $sName = xxx $iRole = 0x00000012 $sRole = dialog $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Children: --------- Window = 0x000F05E2 $sName = $iRole = 0x00000009 $sRole = window $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x001708A6 $sName = System $iRole = 0x00000002 $sRole = menu bar $iState = 0x00008000 $sState = invisible $sName = $iRole = 0x00000001 $sRole = title bar $iState = 0x00008000 $sState = invisible Window = 0x001708A6 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = Application $iRole = 0x00000002 $sRole = menu bar $iState = 0x00008000 $sState = invisible $sName = $iRole = 0x0000000A $sRole = client $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x001708A6 $sName = $iRole = 0x00000009 $sRole = window $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x009D0448 $sName = System $iRole = 0x00000002 $sRole = menu bar $iState = 0x00008000 $sState = invisible $sName = $iRole = 0x00000001 $sRole = title bar $iState = 0x00008000 $sState = invisible Window = 0x009D0448 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = Application $iRole = 0x00000002 $sRole = menu bar $iState = 0x00008000 $sState = invisible $sName = $iRole = 0x0000000A $sRole = client $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x009D0448 $sName = file://C:\Program Files (x86)\xxxx\xxx Client\www\1600\html\update.html?_=1449862098 $iRole = 0x0000000A $sRole = client $iState = 0x00100000 $sState = focusable $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x001B0894 $sName = $iRole = 0x00000010 $sRole = pane $iState = 0x00000040 $sState = read only $sValue = file://C:\Program Files (x86)\xxx\xxx Client\www\1600\html\update.html?_=1449862098 $x, $y, $w, $h = 739, 339, 442, 402 Window = 0x001B0894 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $sName = $iRole = 0x00000021 $sRole = list $iState = 0x00000000 $sState = normal $sValue = $x, $y, $w, $h = 754, 531, 412, 16 Window = 0x001B0894 $sName = Downloading file: $iRole = 0x00000022 $sRole = list item $iState = 0x00008000 $sState = invisible $sValue = $x, $y, $w, $h = 754, 412, 1, 1 Window = 0x001B0894 $iChildElem = 1 $sName = $sName = Time elapsed: 0:00:25 $iRole = 0x00000022 $sRole = list item $iState = 0x00000000 $sState = normal $sValue = $x, $y, $w, $h = 774, 531, 392, 16 Window = 0x001B0894 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $sName = proxy_settings $iRole = 0x0000001E $sRole = link $iState = 0x00400000 $sState = linked $sValue = file:///C:/Program%20Files%20(x86)/xxx/xxx%20Client/www/1600/html/update.html?_=1449862098# $x, $y, $w, $h = 754, 545, 351, 15 Window = 0x001B0894 $iChildElem = 1 $sName = $iChildElem = 6 $sName = $iChildElem = 7 $sName = $iChildElem = 8 $sName = $iChildElem = 9 $sName = $sName = Help $iRole = 0x0000001E $sRole = link $iState = 0x00400000 $sState = linked $sValue = file:///C:/Program%20Files%20(x86)xxx/xxxx%20Client/www/1600/html/update.html?_=1449862098# $x, $y, $w, $h = 1116, 339, 20, 34 $sName = Minimize $iRole = 0x0000001E $sRole = link $iState = 0x00400000 $sState = linked $sValue = file:///C:/Program%20Files%20(x86)/xxx/xxx%20Client/www/1600/html/update.html?_=1449862098# $x, $y, $w, $h = 1136, 339, 20, 34 ;; I think this is it the button################################################################################################### $sName = Close $iRole = 0x0000001E $sRole = link $iState = 0x00400000 $sState = linked $sValue = file:///C:/Program%20Files%20(x86)/xxx/xxx%20Client/www/1600/html/update.html?_=1449862098# $x, $y, $w, $h = 1156, 339, 20, 34 ;;################################# $sName = Vertical $iRole = 0x00000003 $sRole = scroll bar $iState = 0x00008000 $sState = invisible $sValue = 0 Window = 0x009D0448 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = Horizontal $iRole = 0x00000003 $sRole = scroll bar $iState = 0x00008000 $sState = invisible $sValue = 0 Window = 0x009D0448 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = $iRole = 0x00000004 $sRole = grip $iState = 0x00008001 $sState = invisible $sName = Vertical $iRole = 0x00000003 $sRole = scroll bar $iState = 0x00008000 $sState = invisible $sValue = 0 Window = 0x001708A6 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = Horizontal $iRole = 0x00000003 $sRole = scroll bar $iState = 0x00008000 $sState = invisible $sValue = 0 Window = 0x001708A6 $iChildElem = 1 $sName = $iChildElem = 2 $sName = $iChildElem = 3 $sName = $iChildElem = 4 $sName = $iChildElem = 5 $sName = $sName = $iRole = 0x00000004 $sRole = grip $iState = 0x00008001 $sState = invisible ;;############################# code, very minor changes made in libraries to get variables ok #include "ith-CUIAutomation2.au3" #include "ith-MSAccessibility.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $hWindow = WinGetHandle( "xxx" ) If Not $hWindow Then Return ConsoleWrite( "Window handle ERR" & @CRLF ) ConsoleWrite( "Window handle OK" & @CRLF ) ; Get Window object Local $pWindow, $oWindow AccessibleObjectFromWindow( $hWindow, $OBJID_CLIENT, $tIID_IAccessible, $pWindow ) $oWindow = ObjCreateInterface( $pWindow, $sIID_IAccessible, $dtagIAccessible ) If Not IsObj( $oWindow ) Then Return ConsoleWrite( "Window object ERR" & @CRLF ) ConsoleWrite( "Window object OK" & @CRLF ) ; Window name Local $sName ConsoleWrite( @CRLF & "Window:" ) ConsoleWrite( @CRLF & "-------" & @CRLF ) PrintElementInfo( $oWindow, $CHILDID_SELF, "" ) ; Get children ConsoleWrite( "Children:" & @CRLF ) ConsoleWrite( "---------" & @CRLF ) WalkTreeWithAccessibleChildren( $pWindow, 0 ) EndFunc Func WalkTreeWithAccessibleChildren( $pAcc, $iLevel, $iLevels = 0 ) If $iLevels And $iLevel = $iLevels Then Return ; Create object Local $oAcc = ObjCreateInterface( $pAcc, $sIID_IAccessible, $dtagIAccessible ) If Not IsObj( $oAcc ) Then Return $oAcc.AddRef() Local $iChildCount, $iReturnCount, $tVarChildren ; Get children If $oAcc.get_accChildCount( $iChildCount ) Or Not $iChildCount Then Return If AccessibleChildren( $pAcc, 0, $iChildCount, $tVarChildren, $iReturnCount ) Then Return ; Indentation Local $sIndent = "" For $i = 0 To $iLevel - 1 $sIndent &= " " Next Local $hWnd WindowFromAccessibleObject( $pAcc, $hWnd ) ConsoleWrite( $sIndent & "Window = " & $hWnd & @CRLF & @CRLF ) Local $vt, $pChildObj, $oChildObj, $iChildElem ; For each child For $i = 1 To $iReturnCount ; $tVarChildren is an array of VARIANTs with information about the children $vt = BitAND( DllStructGetData( $tVarChildren, $i, 1 ), 0xFFFF ) If $vt = $VT_DISPATCH Then ; Child object $pChildObj = DllStructGetData( $tVarChildren, $i, 3 ) $oChildObj = ObjCreateInterface( $pChildObj, $sIID_IAccessible, $dtagIAccessible ) If IsObj( $oChildObj ) Then PrintElementInfo( $oChildObj, $CHILDID_SELF, $sIndent ) WalkTreeWithAccessibleChildren( $pChildObj, $iLevel + 1, $iLevels ) EndIf Else ; $vt = $VT_I4 ; Child element $iChildElem = DllStructGetData( $tVarChildren, $i, 3 ) PrintElementInfo( $oAcc, $iChildElem, $sIndent ) EndIf Next EndFunc