InfiniyAUS Posted January 20, 2013 Posted January 20, 2013 Hi, I'm tying to automate report generation from an old app. WinActivate works fine but then Send, ControlSend, MouseClick, ControlClick and _WinAPI_Mouse_Event seems to be ignored although the return respond is 1. Below is the code and also attached screenshot with AutoIt info details. What should I try next? - please help #include <ImageSearch.au3> #include <WinAPI.au3> #include <Constants.au3> $x1=0 $y1=0 WinActivate("AccountRight Plus") Sleep(200) $result = _ImageSearch("Accounts.bmp",1,$x1,$y1,0) if $result=1 Then MouseMove($x1,$y1,3) MouseClick("left") Sleep(1000) MouseClick("left") $aMouse = MouseGetPos() ; Remembers current mouse position ConsoleWrite("Mouse Clicked at " & $aMouse[0] & "," & $aMouse[1] & @LF) Sleep(500) ;Try with Handle Local $handle = WinGetHandle("AccountRight Plus") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ConsoleWrite("$handle = " & $handle & @LF) ControlSend($handle, "", "", "^i") EndIf Sleep(1000) ;try winAPI ;MsgBox(0, "Info", "Moving mouse cursor to X-100 and Y-100 from current pos") _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 653, 454) _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTDOWN) Sleep(500) _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTUP) ; try Control Click $controResult=ControlClick("ABC - Command Centre",20806,"left",2,66,105) ConsoleWrite("controlResult = " & $controResult & @LF) Sleep(1000) ; try ControSend to inner frame $controResult=ControlSend("AccountRight Plus","ABC - Command Centre",20806,"{TAB}") ConsoleWrite("controlResult = " & $controResult & @LF) Sleep(1000) ; try ControSend to outer frame $controResult=ControlSend("AccountRight Plus","","","{ALT}") ConsoleWrite("controlResult = " & $controResult & @LF) Sleep(1000) ; try with CLASS $controResult=ControlSend("AccountRight Plus","","[CLASS:MDIClient; INSTANCE:1]","{TAB}") ConsoleWrite("controlResult = " & $controResult & @LF) Sleep(1000) ; try send Send("{TAB}") Sleep(1000) Send("{TAB}") Sleep(1000) ;try MenuSelect WinMenuSelectItem("AccountRight Plus", "", "&File") Sleep(1000) MsgBox(0,"Found","picture found.") EndIf
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now