Sign in to follow this  
Followers 0
Akshay07

How do I automate a click on a button embedded in a window?

5 posts in this topic

Hi all,

Au3Info gave me the following information

>>>> Window <<<<

Title: MyWindow

Class: TdlgWatch

Handle: 0x000306EA

>>>> Control <<<<

Class: TButton

Instance: 4

ClassnameNN: TButton4

Advanced (Class): [CLASS:TButton; INSTANCE:4]

ID: 198608

Text: &Start

Handle: 0x000307D0

How can I click this button using these information (if possible, but not required, without activating the corresponding window)?

Share this post


Link to post
Share on other sites



Hi all,

Au3Info gave me the following information

>>>> Window <<<<

Title: MyWindow

Class: TdlgWatch

Handle: 0x000306EA

>>>> Control <<<<

Class: TButton

Instance: 4

ClassnameNN: TButton4

Advanced (Class): [CLASS:TButton; INSTANCE:4]

ID: 198608

Text: &Start

Handle: 0x000307D0

How can I click this button using these information (if possible, but not required, without activating the corresponding window)?

Open the Helpfile and look at: ControlClick()

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks Jos!

I am always happy to look into the help file but it is so rich that I don't always know where to start, that was why I asked for some help. So a hint like this one is very welcome (and looking at the help file when working on a specific item leads often to find out much more interesting stuff).

Thanks again for the quick answer.

Share this post


Link to post
Share on other sites

Thanks Jos!

I am always happy to look into the help file but it is so rich that I don't always know where to start, that was why I asked for some help. So a hint like this one is very welcome (and looking at the help file when working on a specific item leads often to find out much more interesting stuff).

Thanks again for the quick answer.

It meant it the way I wrote it, but you seems to be reading more into it? :D

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Not at all, in general, I think it is much better for my own learning to be sent back to the help (with some hint on what to look at) instead of being given a "ready to be used" piece of code (well, it depends of the question. sometimes I do need a "ready to be used" piece of code :D)

I can't find a way to read the controlID when the window is created. It's changing every time. I tested the piece of script when the controlID is known, and it works fine (although it does not work if the window is not activated)

WinActivate ( "MyWIndow")
ControlClick ( "", "", "[ID:722338]")

And

ControlClick ( "[CLASS:TButton; INSTANCE:4]", "", "")

Does not work

Edit

ControlClick ( "", "&Start", "") works fine :)
Edited by Akshay07

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  
Followers 0