kcvinu

What we can do with the ouput of "WinGetClassList" and "ControlGetHandle"

9 posts in this topic

Hi all,

What we can do with the output of these two functions.

1. WinGetClassList

2. ControlGetHandle

If this is a silly question, please forgive me. 


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

JohnOne, can i get the text on a control with a control handle. I have tested but it did not work.

Local $Window_title = "Nuendo - [Nuendo Project - 273-278.npr]"

Local $Control_handle = ControlGetHandle($Window_title,"",1)
Local $Control_txt = ControlGetText($Window_title,$Control_handle,1)
Alert($Control_txt)

This is my code. I have tested but not working

And please look this image. This is an audio editor. I need the data in the time display panel. Look the arrow. Window info tool shows "1" as ID.

post-89644-0-05129400-1425907138_thumb.j

Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Um... Pretty sure that WinGetClassList returns an array... :whistle:

Edit:

Are you sure you can get the text from that control?

When you put AutoInfo tool over the control, do you see text in the text output area?

In my experience, those types of controls are generally drawn, if they're not in the "COM" (if it's available) then you very well may need to do an OCR.  Without getting into that, you'd also need to check if IUIAutomation can get the data if AutoInfo tool can't, because if there's no data from AutoInfo tool, then ControlGetText is probably useless.

Edited by SmOke_N
1 person likes this

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

@JohnOne, 2nd parameter is the handle of that control. Infact, i have tested with an empty string as 2nd param. But no way.

@SmokeN, Is there any OCR tool to work with autoit code ?. Because IUAutomation didn't give any better result than Window info Tool.


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I sincerely don't trust them unless I've written them myself for the task at hand.  And it's certainly not something I'd use throughout my company or commercially.

Have you tried contacting the vendor?

Edit:

And as JohnOne said... your parameters are wrong:

ControlGetText($Window_title, "", $Control_handle)

Or

ControlGetText($Control_handle, "", "")

Might work.

Or

WinGetText($Control_handle, "")

Might even work.

Edited by SmOke_N
1 person likes this

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Thank you @SomkeN and @JohnOne


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

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

  • Similar Content

    • babyjoe
      By babyjoe
      I've run into something peculiar, which I haven't been able to find more info on with the search.

      The issue is a dropdownbox-control which I want to click, in a .NET program. The Class changes for everytime it is run.
      When I do a normal ControlClick, nothing happens and it exits with 0.

      I tried ControlClick referencing the control with [NAME:] and/or with [TEXT:] but that does not work.
      However, if right before the ControlClick, I do a ControlGetHandle statement, then the ControlClick will suddenly work after all...

      The window title stays the same, and there is only 1 control with that text.
      Example:
      ControlClick("Navigator","","[TEXT:Raster]") does not work. Returns with 0.
      ----
      ControlGetHandle("Navigator","","[TEXT:Raster]") Returns with 1.
      ControlClick("Navigator","","[TEXT:Raster]") works and returns with 1.

      Why is this happening?
      I'm glad it works, but I get the feeling I'm doing something in a wrong way.