Jump to content

Need help to get a button properties


 Share

Recommended Posts

Hi all,

I am (once again) asking for some help!

I would like to get the properties of a button for a program. I want to detect when it is available and then simulate a click on this button.

One person (sorry, I don't remember the name) helped me out a few weeks ago to get the various parameter of various existing windows using this script:

#include <WinAPI.au3>
Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $aWindows, $i, $text
    $aWindows = _WinAPI_EnumWindows()
    For $i = 1 To UBound($aWindows) - 1
        $text = "Window Handle: " & $aWindows[$i][0] & @LF
        $text &= "Window Class: " & $aWindows[$i][1] & @LF
        $text &= "Window Title: " & WinGetTitle($aWindows[$i][0]) & @LF
        $text &= "Window Text: " & WinGetText($aWindows[$i][0]) & @LF
        $text &= "Window Process: " & WinGetProcess($aWindows[$i][0])
        MsgBox(0, "Item " & $i & " of " & UBound($aWindows) - 1, $text)
    Next
EndFunc

This small script helped me a lot and I thank again the person who indicates it to me.

But is it possible to get the properties of a button by just clicking on it? The program I am using (trying to automate) is quite complicated, and I can't figure out which window is what when I run the script mentioned previously.

Edited by Akshay07
Link to comment
Share on other sites

But is it possible to get the properties of a button by just clicking on it? The program I am using (trying to automate) is quite complicated, and I can't figure out which window is what when I run the script mentioned previously.

Why not just use the AutoIT Window Info Tool? It will give a GUI representation of all window names / info inside the window.

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

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