royalmarine

controlClick - struggling with examples

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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
1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

that worked a treat! Didn't think to use the Name as the controlID.

Share this post


Link to post
Share on other sites

Great :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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