MrKris1224 Posted March 29, 2019 Posted March 29, 2019 (edited) Hi, i'am making automation script to another application in my job. The problem is application have many controls with same class name and instance. So i tried to get handle of controls by them position. There is problem because in application there's many controls that have same position (they ar in another tabs). So i included control's size. It works a long time, but now i need get handle of control which have position and size like another control in application window (in another tab). Can anyone have any solution for that? I think ControlGetFocus will be suitable but that returns ClassnameNN. IT is possible get control handle or ID which is actually focused? Controls isn't standard windows controls. Update Maybe it will help. All controls are from Visual Component Library, application is written in Delphi. It is a way to use VCL lib in autoit? Update This control is "TPageControl". By controls loop i got that control have "TTabSheet" controls which are tabs but Autoit Window Info doesn't showing them (bug?) i got handle to "TTabSheet" control but tab doesnt changing if i use ControlClick. Some info about control: TPageControl Any Ideas? Edited March 29, 2019 by MrKris1224
jdelaney Posted April 10, 2019 Posted April 10, 2019 (edited) My signature can help. Edit: ouch, not standard controls, nevermind. Edited April 10, 2019 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
junkew Posted April 22, 2019 Posted April 22, 2019 Try uia thread in examples section. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
user4157124 Posted April 22, 2019 Posted April 22, 2019 Possible workaround: ControlClick($hWnd, '', '[CLASS:TPageControl; INSTANCE:1]', 'primary', 1, $g_aGuiLoc[$LOC_TAB_2][$COORD_X], $g_aGuiLoc[$LOC_TAB_2][$COORD_Y]) Where $g_aGuiLoc contains coordinates to (somewhere inside) concerning tab header (relative to TPageControl's location). Address controls by INSTANCE. First activation of each tab changes INSTANCE number of controls (cycle through all tabs first for INSTANCE to consistently relate to same control). Now it should be possible to address controls by for example [CLASS:TEdit; INSTANCE:25] (even if another tab than containing one is visible). Not all GUICtrl...() functions work for Delphi controls (most cases solvable using workarounds however). AUERLO (AutoIt error logger)
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