AmatrTatooArtst Posted April 3, 2019 Share Posted April 3, 2019 (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]]]]) Edited April 3, 2019 by AmatrTatooArtst Link to comment Share on other sites More sharing options...
Nine Posted April 3, 2019 Share Posted April 3, 2019 (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 April 3, 2019 by Nine AmatrTatooArtst 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AmatrTatooArtst Posted April 3, 2019 Author Share Posted April 3, 2019 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 Link to comment Share on other sites More sharing options...
jdelaney Posted April 3, 2019 Share Posted April 3, 2019 (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 April 3, 2019 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 More sharing options...
AmatrTatooArtst Posted April 3, 2019 Author Share Posted April 3, 2019 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 Link to comment Share on other sites More sharing options...
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