OldGuyWalking

Identifying Button in Toolbar When There is no ControID

6 posts in this topic

#1 ·  Posted (edited)

I want to click on a button that is inside a custom ToolBar on a nonAutoIT created form.  I've been using MouseClick but that fails if the toolbar is detached or if the form is resized.

There is no ID associated with the toolbar but there is a handle.  I'm thinking that to get the handle I need a ControlID but that only gets me to the toolbar and I'd then need to have a way to identify the position of a button in order to click on it.  

I'd found a discussion about identifying the position of a noname button by, I believe, it's Tip text back in December but I can't find it now.  Memory is a bit fuzzy on how I even got to the topic because at the time I was searching for something else.   I'll continue to search but if anyone has seen the topic, or knows of another solution could you please point me in that direction. 

Thank you.

Edited by OldGuyWalking

Share this post


Link to post
Share on other sites

If you can get the handle you can still click on the specific button you want

https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm

Quote
"SendCommandID", Command ID Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID.

 

Share this post


Link to post
Share on other sites

InunoTaishou - Thank you for the reply. 

The buttons are part of the toolbar and inherit the handle from the toolbar.   The toolbar I'm looking at has 15 buttons.  Using AU3Info and moving across each of the 15, they each show the same handle as the Toolbar.  None of the buttons, nor the Toolbar, show a Control ID in Au3Info.

So, I can a toolbars handle but I cannot identify a specific button to click inside the toolbar because they all show the same information, with one exception, and that's the Visible Text. 

In this application, nothing shows (as in it's totally blank) in AU3Info under the Toolbar or the Statusbar tabs when selecting any toolbar or statusbar.

Thanks again.

 

Share this post


Link to post
Share on other sites

I'd be so interested to see a solution to this other than mouse coord clicking into nowhere. I'm trying to automate Office 2016 PowerPoint, so this is no exotic special case but very common business.

Is there any way to solve this, today?

Share this post


Link to post
Share on other sites
5 hours ago, freefall said:

I'm trying to automate Office 2016 PowerPoint

Then the easiest way is probably to use this: 

 


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

Looks nice. Thank you very much.

But what I'm looking for seems not to be covered by this library. I have to click one single button in an add-in toolbar. Unfortunately, there's no API for this add-in, so there's - as to my knowledge - no other way but clicking this freakin' button.

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

  • Similar Content

    • Bitpicker
      By Bitpicker
      Not the most eloquent nor efficient, to be sure, but with the following functionality:
      MULTI_BAR Features: ----------------------------------------------------------------
          * Floating MULTIBAR Toolbar with four(4) Docking Positions
          * Drag MULTI bar to Dock at any Edge  position
          * Drag Edge bar to screen center to Float as a MULTI bar
          * FADING EDGE BARS for LEFT, TOP-LEFT, TOP-RIGHT, RIGHT Sides
          * All 4 EDGE BARS and MULTI BAR can exist and execute at one time
          * All Toolbars use common INI file format
          * Any Toolbar  can be displayed by any positional Service EXE
          * All ToolBars have common Controls
              Return to calling BAR [ORIGIN}
              Manual Edit the INI file [INIEDIT]
              Create and place a NEW Toolbar on a button [NEWBAR]
              Search Icon Initiator - search for a Toolbar or a Button Function
              Set AUTO mode for EDGE bar show/fade on cursor or click, [AUTOSW]
              Set AUTO mode for FLOAT bar to close or stay open on button click [AUTOSW]
              Rotate thru 3 button sizes, small, medium and large w/label [B-SIZE]
              EXIT this bar [EXIT]
          * User specifies Number of BUTTONS and Number of ROWS
          * Change Dynamically Number of BUTTONS or ROWS
              via NEWBAR Function Specifying SAME BARNAME with Changed BUTTONS & ROWS
          * Three(3) Button sizes - User can change on demand
          * Shrink to Fit - Will Auto reduce Button size on DOCKING if Bar too long    
          * Buttons can be any File OPEN function, web link, or Open another TOOLBAR_BAR
          * ToolBars can be cascaded down(DRILL DOWN - Button points to another ToolBar) to additional Toolbars
              with Return to previous Toolbar via Origin Function
          * 2 BAR TYPES:
              ACTION(Buttons do TOOLBAR, FILE or URL OPENS)
                  User drops a Link on Button
              DROP(Buttons are Folder Targets)dropped files are sorted to destination
                  MOVE or COPY: FILE, FILE(s) or FOLDERS(DIRs) to Button target
                  Recycle Bin(a Shortcut) is supported as a DROP target for FILE, FILE(s) or FOLDERs
          * Button Context functions
              DELETE the current function - empty the button
              EDIT the TOOLTIP for this Button
              EDIT the LABEL displayed on Large Button
              PLUCK this Button for move to new location on this bar -or-
                  ANY other Bar (in this TOOLBOX)  
              PLACE any PLUCKED Button, or PLACE any NEW TOOL_BAR
              OPEN file location of Button file
      UNZIP the attached to a folder which will be the folder for all toolbar definitions
          and executables. THIS FOLDER IS YOUR TOOLBOX.
          TOOLBOX\MULTIBAR\]README.doc or ]README.pdf provides detail on functions and implementing.
                  
      Appreciate all the SILENT help from the AUTOIT community for this and my many projects. Thanks to all menbers who have provided the best self help book on applied AutoIt.
      Please advise on errors or suggestions. MULTIBAR was developed on Windows 10. Other targets or themes may present errors.For your personal use. Accept no responsibility for its functionality. Enjoy, olbitpicker
      MULTIBAR.zip
    • Gyba
      By Gyba
      Hello,
      I have the below toolbar which has buttons that are not visible for the Window Info tool.

      So, in order to be able to click on those buttons, I searched the forum and found the below script which returns all controls for a given window.
      Now that I know the data of the buttons I tried to use the below commands to click a button.  Without any success  :
       
      ;Using the ClassNN ControlClick($HDL, "", "[ClassNN:WindowsForms10.COMBOBOX.app.0.33c0d9d2]") ; Using the button handle ControlClick($HDL, "", 0x001205E2) ; trying to go through the array and select the desired button #include <Functions.au3> #include <Array.au3> $HDL = WinWait("GNB_L_Ro") WinActivate($HDL) $ControlList = _GetAllWindowsControls($HDL) Sleep(1000) ControlClick($HDL, "", $ControlList[37][2]) _ArrayDisplay($ControlList) ;_GetAllWindowsControls function is defined in Functions.au3 and contains the script from the above link.  Any suggestions on how to click one of those buttons? Any help is more than appreciated.
      Thank you!
    • computergroove
      By computergroove
      I've made a form in Koda where I make a list of 3 user definable elements that I want to be able to replicate with a button press so a user can add data that can be used as part of the program. 
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=D:\Carbonite Important\0 - Programing\Scite and Autoit\Koda 1.7.3.0\Forms\Mileage Estimator.kxf $Form1 = GUICreate("Save Project", 614, 1126, 298, 141) $Location = GUICtrlCreateInput("Location", 40, 112, 345, 21) $Distance = GUICtrlCreateInput("Distance", 400, 112, 89, 21) $AddLocation = GUICtrlCreateButton("AddLocation", 288, 80, 97, 25) $Label1 = GUICtrlCreateLabel("Location", 40, 88, 45, 17) $Label2 = GUICtrlCreateLabel("Distance", 400, 88, 46, 17) $HomeBase = GUICtrlCreateInput("HomeBase", 312, 32, 121, 21) $LeapYear = GUICtrlCreateCheckbox("LeapYear", 464, 32, 17, 17) $Label3 = GUICtrlCreateLabel("Leap Year?", 488, 32, 59, 17) $Variance = GUICtrlCreateInput("Variance", 504, 112, 81, 21) $Label4 = GUICtrlCreateLabel("Variance", 504, 88, 46, 17) $Label5 = GUICtrlCreateLabel("Home Base", 312, 8, 59, 17) $Button1 = GUICtrlCreateButton("Button1", 144, 56, 1, 57) $Save = GUICtrlCreateButton("Save Project", 40, 16, 121, 25) $Load = GUICtrlCreateButton("Load Project", 176, 16, 121, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Form1 Case $AddLocation EndSwitch WEnd I want to press the "add location" button and have the fields {Location, Distance and variance} create a new blank record located under the existing 3 input boxes. Since the fields can number over 30 locations in some examples I am thinking about having these items in a scrolling window. What is the best way to do this and can auto it add a variable while running by pressing a button?
    • XaelloNegative
      By XaelloNegative
      Hi,
      I made a small blunder with my code. I created the GUI under 1920x1080 resolution however, my user is configured to ONLY 1080x720 and cannot go any further than that.
      What do you guys think is the best way to correct this one? Resolution mathematics is something that came to mind however I do not have access to his PC to check  from time to time if  my estimation is correct and the resolution on my PC doesn't go down to 1080x720.
      Please help.
      ~XN~
    • davidacrozier
      By davidacrozier
      Hello all ~
      I am running an autoit script on Windows 10 inside VMware Workstation 12 Pro version 12.5.2.  Technically I am remoting into ESXi which has a Domain Controller (DC), WebServer, FilServer, Windows 10, etc.  Using the GUI (i.e. running explorer.exe) I am able to open several different folders successfully.  The desktop, documents, USB external all open without issue.  The network share opening gives me issues.  Whenever I attempt to open \\filserver\users\user\sharedfolder I get the documents folder instead.  I understand that the documents folder is the default for explorer.  I have also attempted to use the letter drive mapped to the network share (Z:) and receive the same result.  When I run this script on Windows 10 alone without  the VM or the ESXi I am able to open the network share without problems.  I have tried to use the net use command to designate a letter M: to the network share folder prior to running the script.  This did not work for me.  
      One additional avenue I think might work is to use the systreeview321 and _GUICtrlTreeView_FindItem to step through the tree looking for the network share.  Once found,  double click on it and see if that opens the shared network folder.  I can click inside the VM with my mouse on the network share and it opens just fine.  Not sure if running up against GUI issues, or permission issues, or what?
      Thanks in advance,
      Davida Crozier
      TestNetworkShare.au3
      This script is a subset of a much larger program, but it illustrates what I am dealing with.