Ipopraw Posted April 20, 2020 Posted April 20, 2020 I am making a script for automation. The button to be pressed has a weird Class: ATL: 08293658. This Class is dynamically numbered. I can not click on the button by ID. Can I Combat Dynamis Class Class ALT? ID and Text are static. The program has several Class ALT buttons with the text Image. What can I do? Class: ATL: 08293658 Instance: 2 ClassnameNN: ATL: 082936582 Name: Advanced (Class): [CLASS: ATL: 08293658; INSTANCE: 2] ID: 12 Text: Image
FrancescoDiMuro Posted April 20, 2020 Posted April 20, 2020 @Ipopraw Use the ID of the control Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Ipopraw Posted April 20, 2020 Author Posted April 20, 2020 50 minutes ago, Ipopraw said: I am making a script for automation. The button to be pressed has a weird Class: ATL: 08293658. This Class is dynamically numbered. I can not click on the button by ID. Can I Combat Dynamis Class Class ALT? ID and Text are static. The program has several Class ALT buttons with the text Image. What can I do? Class: ATL: 08293658 Instance: 2 ClassnameNN: ATL: 082936582 Name: Advanced (Class): [CLASS: ATL: 08293658; INSTANCE: 2] ID: 12 Text: Image This button looks like a arrow picture. Instance static too. Can you get a sample?
Ipopraw Posted April 20, 2020 Author Posted April 20, 2020 25 minutes ago, FrancescoDiMuro said: @Ipopraw Use the ID of the control Can you give example?
FrancescoDiMuro Posted April 20, 2020 Posted April 20, 2020 @Ipopraw There are a bunch of functions which all start with Control* which can help you with your script. Global $hWnd = "Handle/Title of your Window", _ $hControlID hControlID = ControlGetHandle($hWnd, "", 12) ; 12 is the ID of the control you are trying to automate ConsoleWrite("ControlID = " & $hControlID & @CRLF) Open the Help file, try them, and see what happens Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Nine Posted April 20, 2020 Posted April 20, 2020 If the ID changes also, you could use RegExp like this Global $hWnd = WinGetHandle ("Title of your Window") Global $hControlID = ControlGetHandle($hWnd, "", "[REGEXPCLASS:(ALT.*)]") ; class that starts with ALT ConsoleWrite("ControlID = " & $hControlID & @CRLF) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
junkew Posted April 20, 2020 Posted April 20, 2020 Active template library controls from microsoft c++. Check what simplespy or inspect.exe is giving you. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Ipopraw Posted April 21, 2020 Author Posted April 21, 2020 19 hours ago, FrancescoDiMuro said: @Ipopraw There are a bunch of functions which all start with Control* which can help you with your script. Global $hWnd = "Handle/Title of your Window", _ $hControlID hControlID = ControlGetHandle($hWnd, "", 12) ; 12 is the ID of the control you are trying to automate ConsoleWrite("ControlID = " & $hControlID & @CRLF) Open the Help file, try them, and see what happens This script does not compile.
Ipopraw Posted April 21, 2020 Author Posted April 21, 2020 16 hours ago, Nine said: If the ID changes also, you could use RegExp like this Global $hWnd = WinGetHandle ("Title of your Window") Global $hControlID = ControlGetHandle($hWnd, "", "[REGEXPCLASS:(ALT.*)]") ; class that starts with ALT ConsoleWrite("ControlID = " & $hControlID & @CRLF) Thank You! This is work and bast way for me. $hWnd = WinWait("My title") $sButton = "[REGEXPCLASS:ATL:....3658; INSTANCE:2]" ControlClick($hWnd, "", $sButton)
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