Jump to content
Sign in to follow this  
Akshay07

Need help to get a button properties

Recommended Posts

Akshay07

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

Share this post


Link to post
Share on other sites
LurchMan

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.

Share this post


Link to post
Share on other sites
Akshay07

Thanks a lot, I completely forgot about this wonderful tool!

Share this post


Link to post
Share on other sites
dongaman

It seems U have not worked with m$ spy++ :D

Edited by dongaman

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.