royalmarine Posted November 16, 2016 Share Posted November 16, 2016 (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 November 16, 2016 by royalmarine Link to comment Share on other sites More sharing options...
water Posted November 16, 2016 Share Posted November 16, 2016 (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 November 16, 2016 by water royalmarine 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
royalmarine Posted November 16, 2016 Author Share Posted November 16, 2016 that worked a treat! Didn't think to use the Name as the controlID. Link to comment Share on other sites More sharing options...
water Posted November 16, 2016 Share Posted November 16, 2016 Great My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now