#include #include #include #include #include #include #include "CUIAutomation2.au3" #include "UIAWrappers.au3" #AutoIt3Wrapper_UseX64=Y ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os Local $oDesktop run("calc.exe") $oCalc=_UIA_getFirstObjectOfElement($oDesktop,"class:=CalcFrame", $treescope_children) $oNotepad=_UIA_getFirstObjectOfElement($oDesktop,"class:=Notepad", $treescope_children) $sText="1" $oButton=_UIA_getFirstObjectOfElement($oCalc,"name:=" & $sText, $treescope_subtree) $oInvokeP=_UIA_getpattern($oButton,$UIA_InvokePatternID) $oInvokeP.Invoke