Jump to content

Explore controls


APRES
 Share

Recommended Posts

Is it always possible to explore all controls of the running windows application?

I planned with the help of Autoit to make a bridge between the telephony application and the users database.

When the phone is ringing I can see on screen the phone number of caller and I need to catch it.

But I can't.

Autoit Window Info gives on mouse over some control name and says that the control is hidden.

When I get it shown the strip comes above the number I need :"> ...

Edited by APRES
Link to comment
Share on other sites

  • Moderators

Is it always possible to explore all controls of the running windows application?

I planned with the help of Autoit to make a bridge between the telephony application and the users database.

When the phone is ringing I can see on screen the phone number of caller and I need to catch it.

But I can't.

Autoit Window Info gives on mouse over some control name and says that the control is hidden.

When I get it shown the strip comes above the number I need :"> ...

WinGetClassList()?

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.

Link to comment
Share on other sites

WinGetClassList()?

Thank you!

Already one step further. :)

I know now that there are 6 classes.

And then I try ControlGetText for every of 6 classes received. But none gives anything back.

What are other methods to receive information from classes?

Link to comment
Share on other sites

  • Moderators

If there were 6 of them, then with WinGetClassList() doesn't return the number placement.

So if you saw:

Button

Button

Button

Button

Button

Button

The pertinent info that is missing is:

Button1

Button2

Button3

Button4

Button5

Button6

So you were (assuming here) probably doing:

ControlGetText('Window name', '', 'Button')

When you should have done something like:

ControlGetText('Window name', '', 'Button1')

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.

Link to comment
Share on other sites

If there were 6 of them, then with WinGetClassList() doesn't return the number placement.

So if you saw:

Button

Button

Button

Button

Button

Button

The pertinent info that is missing is:

Button1

Button2

Button3

Button4

Button5

Button6

So you were (assuming here) probably doing:

ControlGetText('Window name', '', 'Button')

When you should have done something like:

ControlGetText('Window name', '', 'Button1')

Very interesting.

I received a long list indeed. And I saw many names repeating.

Now going to explore each. Thanks again!

Link to comment
Share on other sites

Link to comment
Share on other sites

I did the following:

$str = WinGetClassList("Title", "")

ConsoleWrite($str)

I received 105 controls of 6 types ( for instance ThunderRT6UserControlDC and ThunderRT6Timer )

According to the list I renamed all od them as many times as each comes out in the list

ThunderRT6UserControlDC1

ThunderRT6UserControlDC2

ThunderRT6UserControlDC3

ThunderRT6Timer1

ThunderRT6Timer2

etc

And then

For $i=1 To 105

$str &= ControlGetText ( "Title", "", $ar[$i])

Next

ConsoleWrite($str)

No result yet... :)

Edited by APRES
Link to comment
Share on other sites

You might also try my solution, it was made because of a similar problem. See "WinControlList (WinGetClassList++)" in my signature.

Thank you for your advise and very nice tool.

I tested it with your function and got exactly the same list of 105 controls I produced by hand...

What are other functions/possibility to explore controls? Maybe the problem is in ControlGetText?

How can image be explored ( if I don't say something stupid ) ?

Link to comment
Share on other sites

Thank you for your advise and very nice tool.

I tested it with your function and got exactly the same list of 105 controls I produced by hand...

What are other functions/possibility to explore controls? Maybe the problem is in ControlGetText?

How can image be explored ( if I don't say something stupid ) ?

If you're asking what I think you're asking, there is no really clean solution I've ever come across. By "explored" I take you to mean focusing on different reactive portions of a graphic.

You MIGHT try something I considered a while back, and creating something akin to an Image Map in HTML. You would have to do it manually, though, and it wouldn't give you substantially better results than using client-area based pixel coordinates... I eventually ended up writing a program that finds one image inside another image, but it's proprietary and I can't share it with you. (It's also in VB.Net, so you might not find it all that useful anyways.)

Did you have something specific in mind? Finding one image inside another is one thing, mapping active areas is another, you might be thinking of something else.

As for other possibilities for exploring controls, check out the other links in my signature, particularly the treeview and menu links. I've been able to adapt that code with some success, and am working on my own solution for toolbars (off and on in my spare time). The only way I've ever been able to pick up anything in a context menu is through OCR, sorry to say. I posted a question about it in support a while back, including an adaptation of the menu code, but nobody ever responded.

The problem you are having with ControlGetText is because these aren't standard (reade: Microsoft Common Controls) controls. The text may even be rendered as an image. Again, OCR is one way to approach that, but if you only plan to use this code for one program you might prefer to just assume you know what each item does and comment your code heavily.

On the off chance you work for the people who created Thunder controls, you might ask for an API spec for the hosting DLL, or a list of the message constants.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...