JJ_07 Posted September 3, 2019 Share Posted September 3, 2019 Hello, I'm new to AutoIt and I am trying to automate an application that wasn't developed by me and after using the "AutoIt v3 Window Info" turns out that multiple controls have the same ID number and only the coordinate numbers are different, no class or instace number is available. I tried to use the Advanced controlID feature: ControlSend('Set Measurement Channels', "", "[X:268; Y:76; W:64; H:24]", "sample_text" ) where the position and size of the control could be added, but it did not work. Altough, it did using only the ID: ControlSend('Set Measurement Channels', "", "[ID:1060]", "sample_text" ) This sent the text to the first control, but since the other controls also have the same ID, this approach is wouldn't work... I attached two pictures of the returned information from AutoIt V3 Window Info of two different controls. Is there any way to send text to this controls with the information that is available? another tool that could help me find the ID of each of them? or am I sending the coordinates in the wrong way? Thanks in advance Link to comment Share on other sites More sharing options...
Nine Posted September 3, 2019 Share Posted September 3, 2019 Have you tried combining both ID and position ? If that doesn't work you could use : #include <WinAPISysWin.au3> ; put those 2 lines on top of your script #include <Array.au3> Local $hWnd = WinGetHandle ("Set Measurement Channels") Local $aArr = _WinAPI_EnumChildWindows ($hWnd) _ArrayDisplay ($aArr) You can then use the handles retrieve in the array to access each control “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Werty Posted September 3, 2019 Share Posted September 3, 2019 (edited) 56 minutes ago, JJ_07 said: another tool that could help me find the ID of each of them? Try Yashieds "Control Viewer", same as the infotool, just better, picks up more. Edited September 3, 2019 by Werty Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
JJ_07 Posted September 4, 2019 Author Share Posted September 4, 2019 17 hours ago, Werty said: Try Yashieds "Control Viewer", same as the infotool, just better, picks up more. 18 hours ago, Nine said: Have you tried combining both ID and position ? If that doesn't work you could use : #include <WinAPISysWin.au3> ; put those 2 lines on top of your script #include <Array.au3> Local $hWnd = WinGetHandle ("Set Measurement Channels") Local $aArr = _WinAPI_EnumChildWindows ($hWnd) _ArrayDisplay ($aArr) You can then use the handles retrieve in the array to access each control Thanks Nine, it worked using the Handle as the ControlID ! And I tried using both ID and position but still only the first control was being accessed. ControlSetText('Set Measurement Channels', "", $aArr[12][0] , "333" ) Link to comment Share on other sites More sharing options...
JJ_07 Posted September 4, 2019 Author Share Posted September 4, 2019 17 hours ago, Werty said: Try Yashieds "Control Viewer", same as the infotool, just better, picks up more. Thank you, I will use this one instead. Link to comment Share on other sites More sharing options...
Nine Posted September 4, 2019 Share Posted September 4, 2019 1 hour ago, JJ_07 said: Thanks Nine, it worked using the Handle as the ControlID ! Great, glad it worked. Also you should use the handle of the window like this : #include <WinAPISysWin.au3> ; put those 2 lines on top of your script #include <Array.au3> Local $hWnd = WinGetHandle ("Set Measurement Channels") Local $aArr = _WinAPI_EnumChildWindows ($hWnd) ControlSetText($hWnd, "", $aArr[12][0] , "333" ) JJ_07 1 “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) Screen Scraping Multi-Threading Made Easy 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