Jump to content
AmatrTatooArtst

Mouse ControlClick for unlabeled button

Recommended Posts

Posted (edited)

I am trying to do a controlclick to press a button that seems to not have any kind of label and no hotkey.  I am trying to click the open button of the SQLQuery tab in the pic below.  If I hover over it I get the AutoIT Window Info as shown.  This is my first time using ControlClick, and I'm trying to do it with this line of code.  Any help is greatly appreciated.

ControlClick ("ProgramName", "", "[Class:TToolBar; Instance:2]" [, button = "left" [, Clicks = 1 [, 75 [, 25]]]])

image.jpeg.71751212dfce61313e606f4692fa5bd6.jpeg              image.jpeg.aad37b5c0d441869eb92e65c89a3f940.jpeg

Edited by AmatrTatooArtst

Share this post


Link to post
Share on other sites
Posted (edited)

The "[" and "]" do not belong to the function.  It is there for documentation purposes (except for the title special definition).  So your statement should be :

ControlClick ("ProgramName", "", "[Class:TToolBar; Instance:2]", "left", 1, 75, 25)

 

Edited by Nine

Share this post


Link to post
Share on other sites

That works!!  I was still having problems with it not working, but once I added a wait between opening the query tab and the controlclick it worked like a charm.  Thanks again Nine

Share this post


Link to post
Share on other sites
Posted (edited)

Does the toolbar tab include any output?  if so, you can get the details of your specific item to click rather than relative positions on the toolbar. 

 

Helpful note in the future, copy the full text of the spy tool, and not just a partial screenshot

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.

Share this post


Link to post
Share on other sites

Here's the full spy tool output.  As far as I know the toolbar doesn't include any output.  I looked into a bunch of different ways to do it so I wouldn't have to use ControlClick, that was a last resort.  If there a better way I'm all ears.  My first time using AutoIT and I have a ~150 line script I would love to make as simple and fool proof as possible.

 

>>>> Window <<<<
Title:    ProgramName
Class:    TForm1
Position:    -8, -8
Size:    1936, 1056
Style:    0x17CF0000
ExStyle:    0x00010110
Handle:    0x00000000015A10D0

>>>> Control <<<<
Class:    TToolBar
Instance:    2
ClassnameNN:    TToolBar2
Name:    
Advanced (Class):    [CLASS:TToolBar; INSTANCE:2]
ID:    55052450
Text:    
Position:    6, 93
Size:    1910, 56
ControlClick Coords:    75, 25
Style:    0x5600884E
ExStyle:    0x00010000
Handle:    0x00000000034808A2

>>>> Mouse <<<<
Position:    81, 141
Cursor ID:    2
Color:    0xF1CB58

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Query
SQL Query
ToolBar3
Auto size columns
Non result query (update query)
Show Side Panel
ToolBar1
ToolBar2
ToolBar1


>>>> Hidden Text <<<<
Table List
Show Views
Show Tables
Count: 13
Welcome

 

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

×
×
  • Create New...