jpierson Posted March 29, 2010 Share Posted March 29, 2010 The problem I have is this. I have program that launches multiple sub windows and forms. They are dynamic, the number of controls on each is dynamic in most instances. I'm looking for a method to obtain the ClassNN or Handle based on partial text within the control. An example would be, I have an edit control, it has a text value that begins with 9999. I would like to obtain its classNN so I can obtain the full text string. Any help would be most appreciated. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 29, 2010 Share Posted March 29, 2010 (edited) One method is to start with WinGetClassList(), then loop through the classes you want, appending the "NN" part to test the controls from, say, Edit1 thru Edit99.P.S. You can specify the text in an advanced control ID, but unfortunately it has to be the FULL text. That's not a problem with just "&Next" on a button, but could be a problem with long strings in an edit or input control: $hEdit = ControlGetHandle($hWnd, "", "[CLASS:Edit; Text:This is the full text.]") Edited March 29, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Yoriz Posted March 29, 2010 Share Posted March 29, 2010 check these out windows controls finding all controlids in a window _EnumChildWindows Enumerate Controls/Children of Window GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
bo8ster Posted March 30, 2010 Share Posted March 30, 2010 The link "Control Handle under mouse" in my sig has the functions that do what you ask. _ControlGetClassnameNN ClassNN is contrived by AutoIt - it does not exist in windows. It is created, as PsaltyDS pointed out, by using WinGetClassList(). Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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