birbird Posted June 29, 2015 Posted June 29, 2015 This is the code of mine$aList = WinList("[CLASS:#32770; W:491; H:369]")It does not work. Could anyone please tell what is the right way to use size to find window?
JohnOne Posted June 29, 2015 Posted June 29, 2015 Works fine here.Show all your code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
water Posted June 29, 2015 Posted June 29, 2015 Works fine here when used with Notepad. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted June 29, 2015 Posted June 29, 2015 When you say "does not work", how do you know that it does not work? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
birbird Posted June 29, 2015 Author Posted June 29, 2015 I don't know why, maybe the application is not well written.On a window, there are 2 controls with the same ID. The one is a Edit, the other is a Static (Class).ControlSetText($hWnd, "", "[ID:1032]", "")can not find the control I want.ControlSetText($hWnd, "", "[CLASSNN:Edit7]", "")can not work either, because the number after Edit vary in different run.ControlSetText($hWnd, "", "[CLASS:Edit; ID:1032]", "")is right logically, but it seems other parameter is ignored if ID presents. This does not work either.How could I get the Edit with ID 1032 while there is another control's ID is 1032 too?Any help will highly appreciated!
birbird Posted June 29, 2015 Author Posted June 29, 2015 (edited) I find a workaround is that click an other control first (it has an unique ID), then the Edit will get focus as designed, then Send will do the job.But I still want to know if I can ControlSetText it under this situation? Edited June 29, 2015 by birbird
MikahS Posted June 29, 2015 Posted June 29, 2015 Can you post the Info you get from the Window info tool? It could have differences in instance numbers that you can use to specify which control you want. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
birbird Posted June 29, 2015 Author Posted June 29, 2015 (edited) Can you post the Info you get from the Window info tool? It could have differences in instance numbers that you can use to specify which control you want.Thank you for your idea.I guess you mean ControlSetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]", "")I have tried it, I fail because the instance num vary in different run.The Window Info is like this Edited June 29, 2015 by birbird
birbird Posted June 29, 2015 Author Posted June 29, 2015 Sorry new to autoit, after frustrated much, I think finding control by position and size is a reliable method.But I can't make it work, this is my test code to caculator.$hWnd = WinWait("[W:423; H:323]") ConsoleWrite($hWnd & @CRLF) Local $sText = ControlGetText($hWnd, "", "[ID:323]") ConsoleWrite($sText & @CRLF) Local $sText2 = ControlGetText($hWnd, "", "[X:150; Y:70; W:50; H:16]") ConsoleWrite($sText2 & @CRLF)It can find the control by ID, but fail by position and size. Please help The Window Info is
birbird Posted June 29, 2015 Author Posted June 29, 2015 This code work well to windows caculator$hWnd = WinWait("[W:423; H:323]") ConsoleWrite($hWnd & @CRLF)So it shoud be something else wrong with my code, nothing to do with W / H
water Posted June 29, 2015 Posted June 29, 2015 Can you please explain why you need to find controls by position and not by ID or Classname? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
birbird Posted June 29, 2015 Author Posted June 29, 2015 Can you please explain why you need to find controls by position and not by ID or Classname?Please see this post #1255468
water Posted June 29, 2015 Posted June 29, 2015 Why did you start a second thread for the same problem? I'm sure searching a control by its coordinates isnt't the best way.I've never heard of two controls having the same ID.Can you please post the screenshot of the AutoIt Window Info Tool for BOTH controls? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Developers Jos Posted June 29, 2015 Developers Posted June 29, 2015 (edited) 3 threads merged, please stick to one thread from here on.Jos Edited June 29, 2015 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
birbird Posted June 29, 2015 Author Posted June 29, 2015 (edited) Why did you start a second thread for the same problem? I'm sure searching a control by its coordinates isnt't the best way.I've never heard of two controls having the same ID.Can you please post the screenshot of the AutoIt Window Info Tool for BOTH controls?Here they are Edited June 29, 2015 by birbird
water Posted June 29, 2015 Posted June 29, 2015 Have you tried to access the control by specifying the Value from "Advanced Mode"? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
birbird Posted June 29, 2015 Author Posted June 29, 2015 (edited) 3 threads merged, please stick to one thread from here on.JosSorry for too many threads.I started a thread about how to find control by position and size just because it is a stand alone problem.I just red https://www.autoitscript.com/autoit3/docs/intro/controls.htm, it says position and size can be used to identify a control, but no example. Then I write an example, but not work and don't know what is wrong.So I started a thread ask for identify a control by position and size.No matter how I solve the other problem finally, I want know the right way to find a control by position and size.Please help me. And, at least the identify window by size problem should not be merged, it has nothing to do with other problems.Anyway, I am clear about the window problem, that's all right. Edited June 29, 2015 by birbird
birbird Posted June 29, 2015 Author Posted June 29, 2015 Have you tried to access the control by specifying the Value from "Advanced Mode"?Yes, I tried. This is my preceding postThank you for your idea.I guess you mean ControlSetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]", "")I have tried it, I fail because the instance num vary in different run.
water Posted June 29, 2015 Posted June 29, 2015 Can you please tell us which application you try to automate? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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