Jump to content

Recommended Posts

Posted

In the following script, ControlClick does not send the ControlID, 3, for the button labeled "Analyze" to the program. How can I use its ClassNameNN "ThunderRT6CommandButton3" as an alternative for the ControlID? Thanks.

; Script Start - Add your code below here

Opt("TrayIconDebug", 1)

Run ("E:\program files\ccleaner\ccleaner.exe")

WinWaitActive("CCleaner")

ControlClick ( "ccleaner", "", 3)

Posted

Welcom to forum!

  Quote

n the following script, ControlClick does not send the ControlID

It's not supose to, ControlClick() is click the button/checkbox/(or some control) :whistle:

If the classname of control is known, then you just click it:

ControlClick ( "ccleaner", "", "Button3")

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  Daveski said:

...

WinWaitActive("CCleaner")

ControlClick ( "ccleaner", "", 3)

Window titles are case sensitive and yet your titles above are different so will not work. The ControlID is incorrect by what I see as the text of the control does not match &Analyze. If you move the mouse to the edge of the button then you may see different.

  AutoIt Info said:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: CCleaner

Class: ThunderRT6FormDC

Size: X: 162 Y: 450 W: 620 H: 420

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 603 Y: 809

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xF0F0F0 Dec: 15790320

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 312 Y: 322 W: 121 H: 28

Control ID: 1

ClassNameNN: ThunderRT6CommandButton1

Text: &Analyze

Style: 0x54012000

ExStyle: 0x00000004

You could use ComtrolID 1 or ClassnameNN "ThunderRT6CommandButton1" or even the text "&Analyze".

Opt("TrayIconDebug", 1)
Run ("E:\program files\ccleaner\ccleaner.exe")
WinWait("CCleaner")
ControlClick ( "CCleaner", "&Analyze", "ThunderRT6CommandButton1")

:whistle:

Posted

  MsCreatoR said:

Welcom to forum!

It's not supose to, ControlClick() is click the button/checkbox/(or some control) ;)

If the classname of control is known, then you just click it:

ControlClick ( "ccleaner", "", "Button3")

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...