Jump to content
Sign in to follow this  
InfiniyAUS

AUTOIT challenge - App doesn't respond to Send / ConrolSend

Recommended Posts

InfiniyAUS

post-77504-0-64271800-1358656526_thumb.p

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×