Jump to content

How can i get a button inside in Panel - (Moved)


gvsilva
 Share

Recommended Posts

Hello everyone.

I am new with autoit, I have a difficulty because I need to automate an application and it has a button inside a panel, I need to click that button.
But when using AutoIt v3 Window Info it does not give me the name of the button, it just gives me the name of the Panel.

How do I find the buttons inside the panel? Is there a command for this?
with the command:
ControlClick ("TITLE", "", "[CLASS: TFlatPanel; INSTANCE: 4]"), I'm seeing the panel and clicking it, but I can't see the button.

I don't want to use mouse position

Link to comment
Share on other sites

  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You can see more controls through code (sometimes). Try something like this to get the full list of controls: (I used the active window, but you could use a handle or the title instead)

#include <Array.au3>

_ArrayDisplay(GetControlNames(WinGetHandle("[ACTIVE]")))

Func GetControlNames($hWnd)
    ; An array of control names to return
    Local $aControlNames[0]
    ; Get the list of controls from the window and split into an array
    Local $aTemp = StringSplit(WinGetClassList($hWnd), @LF)
    ; The control name
    Local $sControlName
    
    Local $iCount
    
    ; For each control found
    For $i = 1 To UBound($aTemp) - 1
        $iCount = 1
        Do
            ; Build a name
            $sControlName = "[CLASS:" & $aTemp[$i] & ";INSTANCE:" & $iCount & "]"
            $iCount += 1
        ; Loop until the name isn't taken
        Until Not _ArrayContains($aControlNames, $sControlName)
        
        ; Add it to the array of controls
        _ArrayAdd($aControlNames, $sControlName)

    Next
    
    Return $aControlNames

EndFunc

; Checks if an item is in an array already
Func _ArrayContains($aArray, $vItem)

    For $i=0 To UBound($aArray) - 1

        If $aArray[$i] == $vItem Then Return True

    Next

    Return False

EndFunc

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

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...