Jump to content

AutoIT v3 click image that acts as button


Recommended Posts

i am trying to click a button in the showmypc application (showmypc.com), called "show my pc now"

i am trying to click on a button but based off the window info from autoIT, it looks like its a picture box. i have tried using mouse click and control click with no luck. i read a few posts about using IE.au3 with image click functionality but got the impression that only works with I.E.

for mouse click i moved the window to certain x, y and used window info to get button coords. tried using mouse click with coords and did not work, no response / error.

used control click like below and still no go, no response / error

ControlClick("ShowMyPC Collaboration 3152 ","","ThunderRT6PictureBoxDC4", "left")

ControlClick("ShowMyPC Collaboration 3152 ","","[CLASS:ThunderRT6PictureBoxDC; INSTANCE:4]", "left")

here is the info from window info finder

>>>> Window <<<<

Title: ShowMyPC Collaboration 3152

Class: ThunderRT6FormDC

Position: 579, 248

Size: 524, 483

Style: 0x16CE0000

ExStyle: 0x00040100

Handle: 0x0046142E

>>>> Control <<<<

Class: ThunderRT6PictureBoxDC

Instance: 4

ClassnameNN: ThunderRT6PictureBoxDC4

Name:

Advanced (Class): [CLASS:ThunderRT6PictureBoxDC; INSTANCE:4]

ID: 6

Text:

Position: 16, 80

Size: 227, 43

ControlClick Coords: 106, 21

Style: 0x56010000

ExStyle: 0x00000004

Handle: 0x0051144A

>>>> Mouse <<<<

Position: 709, 379

Cursor ID: 0

Color: 0x6E6E6E

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Allow Full Control

Frame1

00:00:00

8:22:42 AM Select an option and Start

English

Link to comment
Share on other sites

Something like this will tell you what's up (debugging)...send back the output...

#include <Array.au3>
$aWin = WinList("[CLASS:ThunderRT6FormDC]")
ConsoleWrite("Total windows found=[" & UBound($aWin) & "]." & @CRLF)
For $i = 1 To UBound($aWin)-1
 ConsoleWrite("Click window #=[" & $i & "]; hwnd=[" & $aWin[$i][1] & "]; title=[" & $aWin[$i][0] & "]")
 If Not WinActivate($aWin[$i][1]) Then
  ConsoleWrite("...can't activate current window." & @CRLF)
  ContinueLoop
 EndIf
 $hControl = ControlGetHandle($aWin[$i][1], "", 6)
 If Not IsHWnd($hControl) Then
  ConsoleWrite("...can't find control." & @CRLF)
  ContinueLoop  
 EndIf
 
 If Not ControlFocus($aWin[$i][1], "", $hControl) Then
  ConsoleWrite("...can't focus on control." & @CRLF)
  ContinueLoop  
 EndIf
 
 If Not ControlClick($aWin[$i][1], "", $hControl) Then
  ConsoleWrite("...can't click control." & @CRLF)
  ContinueLoop  
 EndIf
 
 ConsoleWrite("...clicked control." & @CRLF)
Next

also, i generally like to verify the states of the window and controls, prior to performing actions...look in the helpfile to get those.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

thanks for the reply jdelaney. here is the output

Total windows found=[12].

Click window #=[1]; hwnd=[0x00360C06]; title=[share Application]...can't find control.

Click window #=[2]; hwnd=[0x001D10C0]; title=[showMyPC Collaboration 3152]...clicked control.

Click window #=[3]; hwnd=[0x003A0A46]; title=[]...can't find control.

Click window #=[4]; hwnd=[0x002D0FBE]; title=[Login]...can't find control.

Click window #=[5]; hwnd=[0x006C029A]; title=[Enter]...can't find control.

Click window #=[6]; hwnd=[0x007F0CFC]; title=[scheduled Meeting]...clicked control.

Click window #=[7]; hwnd=[0x007F0DD2]; title=[Login]...can't focus on control.

Click window #=[8]; hwnd=[0x01EA046C]; title=[screen Shot]...can't find control.

Click window #=[9]; hwnd=[0x006A0934]; title=[Record My Screen]...can't focus on control.

Click window #=[10]; hwnd=[0x00A40BE2]; title=[Debug Report]...can't find control.

Click window #=[11]; hwnd=[0x00571514]; title=[Connection Settings]...can't focus on control.

+>13:26:05 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 7.239

Link to comment
Share on other sites

did this itteration in the loop click the control as expected?

Click window #=[2]; hwnd=[0x001D10C0]; title=[showMyPC Collaboration 3152]...clicked control.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Its a Java application look for Java Accessibility. I certainly doubt if someone has bridged the Java Accessbility into AutoIT. If you can turn on Java runtime accessibility (i really donot know if thats possible) you should be able to use microsoft accessiblity in combination with the Java accessibility bridge tooling (see oracle documentation)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...