Sign in to follow this  
Followers 0
jpierson

obtain ClassNN or Hande of Control

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0