Jump to content

controlClick - struggling with examples


Recommended Posts

Hi all,

Struggling to get a button to click.

Have a simple application in Windows 7 that has various buttons. I've used au3Info to record details, and using the help file for ControlClick, get my script to click the button...

Alas, no joy.. Could someone point out what I'm doing wrong, so I can fix this?

Example()

Func Example()

    Sleep(5000)
    
;ControlClick ( "3-0929 HMI  testVistakon3._32NVD_Momomer.map Login : JJHE", "init", "[ID:9]")

;ControlClick ( "3-0929 HMI  testVistakon3._32NVD_Momomer.map Login : JJHE", "init", 9)

ControlClick ( "3-0929 HMI  testVistakon3._32NVD_Momomer.map Login : JJHE", "init", "[ID:9]")


EndFunc   ;==>Example

Info from au3info

 

Quote

>>>> Window <<<<

Title:    3-0929 HMI  testVistakon3._32NVD_Momomer.map    Login : JJHE

Class:    WindowsForms10.Window.8.app.0.378734a

Position:    248, 0 Size:    1279, 977

Style:    0x16CF0000

ExStyle:    0x00050100

Handle:    0x00020368

>>>> Control <<<<

Class:    WindowsForms10.BUTTON.app.0.378734a

Instance:    9

ClassnameNN:    

WindowsForms10.BUTTON.app.0.378734a9

Name:    buttonInit

Advanced (Class):    [NAME:buttonInit]

ID:    66552

Text:    Init

Position:    205, 315

Size:    91, 41

ControlClick Coords:    63, 32

Style:    0x5601000B

ExStyle:    0x00000000

Handle:    0x000103F8

>>>> Mouse <<<<

Position:    524, 377

Cursor ID:    0

Color:    0xD4D4D4

 

 

Thanks!

Edited by royalmarine
Link to comment
Share on other sites

Try:

ControlClick("3-0929 HMI  testVistakon3._32NVD_Momomer.map    Login : JJHE", "", "[NAME:buttonInit]")

Note the extra spaces in the title plus the changed name of the button.
If it still doesn't work then yo might be out of luck because WindowsForms GUIs are hard/impossible to automate.
You will find some discussion on this  subject when searching the forum.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Great :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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