Jump to content

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


 Share

Recommended Posts

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)?

Link to comment
Share on other sites

  • Developers

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()

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

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.

Link to comment
Share on other sites

  • Developers

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

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

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