BigDaddyO Posted November 29, 2005 Share Posted November 29, 2005 (edited) I am attemtpting to automate a .NET web Application using normal AutoIT functions and I have been having a lot more success then I thought I would. My Problem is that I ran into an area where the AutoIT Info tool can't see the Controls, I used Winspector which is able to see many different controls with the same names, only the HWND's are different. I used the ControlClick using the HWND of the item I want to select and it worked. But How can I get the HWND using AutoIT when I can't see the control to use the ControlGetHandle? Below is a picture of what Winspector shows of the area with the controls. Any help would be Greatly appreciated. Mike edit: from the image below 0x001B0400 is the HWND I used successfully to select the ComboBox. Edited November 29, 2005 by MikeOsdx Link to comment Share on other sites More sharing options...
AutoIT Geek Posted November 29, 2005 Share Posted November 29, 2005 Each control has a handle, a class name and a name, there is a tool called WinID v3.0.it tells a LOT of info about windows and controls.http://www.dennisbabkin.com/php/download.php?what=WinIDtry using that first and give a feedback if you need more help Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 29, 2005 Author Share Posted November 29, 2005 OK, Using the WinID I have attached 3 screenshots below. The first is the info on the ComboBox I want to select. The Second is of the Same ComboBox after closing and re-launching the .NET application The Third is of a ComboBox located next to the one I want, This is just to show you that the only apparent differences between the two ComboBoxes are the items that Windows generates when launching the application. Mike Link to comment Share on other sites More sharing options...
AutoIT Geek Posted November 29, 2005 Share Posted November 29, 2005 I See, well, before i can help, if you dont mind me asking, what is your expiriance with the following : DLLCALL() Win API -> GetWindow Win API -> GetClassName basiclly, all you need to do is to enumerate the controls that you want, by their handls and check there class names for -> 'WindowsForms.10.COMBOBOX.app10' . Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 29, 2005 Author Share Posted November 29, 2005 Larry, If I understand your code correctly you are cycling through WindowsForms10.COMBOBOX.app10 and adding 1 to the end of the control name, but my problem is that I have 6 Combo Boxes with the Exact same Control name of WindowsForms10.COMBOBOX.app10 the only way I can tell the difference between them is with the HWND. Is there a way to loop through all HWND's that match the WindowsForms10.COMBOBOX.app10 controls?, it may take a while but if that's possible I could look inside each combobox looking for specific data in the combobox. once I find the Data I'll know which one is which. AutoIT Geek, As for the API and DLL calls, I would be called an amature but I usually catch on quickly. Thanks, Mike Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 29, 2005 Author Share Posted November 29, 2005 I am looking at...WindowsForms10.COMBOBOX.app101WindowsForms10.COMBOBOX.app102WindowsForms10.COMBOBOX.app103WindowsForms10.COMBOBOX.app104WindowsForms10.COMBOBOX.app105WindowsForms10.COMBOBOX.app106... until AutoIt says I get an errorLar.Right, that's what I thought, But my problems is I have the following Combo Boxes on one screenWindowsForms10.COMBOBOX.app10 with a HWND of 0x00010844WindowsForms10.COMBOBOX.app10 with a HWND of 0x00030884WindowsForms10.COMBOBOX.app10 with a HWND of 0x00020880WindowsForms10.COMBOBOX.app10 with a HWND of 0x0002087AWindowsForms10.COMBOBOX.app10 with a HWND of 0x00020874WindowsForms10.COMBOBOX.app10 with a HWND of 0x0002086EWindowsForms10.COMBOBOX.app10 with a HWND of 0x00020868the 2nd one in the list above is the one I want but so Far I can only select it using the HWND that I have to manually look up with an External program Winspector, the AutoIT Info tool can't seem to see them.Mike Link to comment Share on other sites More sharing options...
Angel Posted November 29, 2005 Share Posted November 29, 2005 $hwnd = ControlGetHandle("Title","","WindowsForms10.COMBOBOX.app102")Larry, why do you put "Title" as the window title? in the screenshots that he showed the title seems emtpy...Angle Link to comment Share on other sites More sharing options...
LxP Posted November 30, 2005 Share Posted November 30, 2005 Larry's approach is what I'm essentially about to offer, but perhaps you'd like to look at _ControlGetHandleByPos() which will give you access to a control via its position. Link to comment Share on other sites More sharing options...
AutoIT Geek Posted November 30, 2005 Share Posted November 30, 2005 larry offerd a good option to start with, try it. this approch will enumerate each control by its instance and since you have only six by specific order it hard to get lost. my own advice is more ... win API releated and erquires a bit more programming. enumerating hwnds in a windows goes by specific order. you can get down to forth level grandchildren. look at the pointers i gave you and give feedback if you would like more help. have joy. Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 30, 2005 Author Share Posted November 30, 2005 I'm Done... I am going to use Mouse clicks. I got it to work using the .102 as Larry suggested but only the first time. When I closed the app, reopened it and tried it again it didn't work. Turns out that since the combo boxes are inside a WindowsForms10.window.8.app104 and they are not visible until you click on the space they are located in, not even the WinGetClassList shows them until I have clicked on them to show them at least once. Why do Web Applications always have to be a pain in the Ass...? So, Thank you all for the effort, but I have so much more do do with this script I am just going to send mouse clicks for now. Mike 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