mro2

get handle for control with x/y position not working

6 posts in this topic

Hi,

can someone explain why this is not working when I specify X or XandY, but it does work when I specify e.g. W, which I don't want since the size of the control/window can vary....

(see also screenshot):

$id = "[CLASS:TPageControl; X:210]"
$id2 = "[CLASS:TPageControl; W:929]"

$h2 = ControlGetHandle("title", "text", $id)
ConsoleWrite("h2:" & $h2 & @CRLF)
$h3 = ControlGetHandle("title", "text", $id2)
ConsoleWrite("h3:" & $h3 & @CRLF)

h2:
h3:0x00181574

post-63539-0-27911100-1312457961_thumb.p

Share this post


Link to post
Share on other sites



Alright, brute force has shown that it works for X:1.

So I assume coordinates are relative to the CLASS:TPageControl control found. Although there are several instances of such a control. Hmmm....

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi,

can someone explain why this is not working when I specify X or XandY, but it does work when I specify e.g. W, which I don't want since the size of the control/window can vary....

(see also screenshot):

$id = "[CLASS:TPageControl; X:210]"
$id2 = "[CLASS:TPageControl; W:929]"

$h2 = ControlGetHandle("title", "text", $id)
ConsoleWrite("h2:" & $h2 & @CRLF)
$h3 = ControlGetHandle("title", "text", $id2)
ConsoleWrite("h3:" & $h3 & @CRLF)

h2:
h3:0x00181574

because it`s wrong.

What is "Title" and "text"?

I never work using the position and size of a control, but maybe This.

$h2 = ControlGetHandle("[CLASS:TPageControl;INSTANCE:4]", "", "[CLASS:TPageControl; X:210]")
ConsoleWrite("h2:" & $h2 & @CRLF)
Edited by monoscout999

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

because it`s wrong.

What is "Title" and "text"?

Well, title and text (well some text, or just "") of the window that contains the control. So I thought.

I never work using the position and size of a control, but maybe This.

$h2 = ControlGetHandle("[CLASS:TPageControl;INSTANCE:4]", "", "[CLASS:TPageControl; X:210]")
ConsoleWrite("h2:" & $h2 & @CRLF)

Can't match the Instance ID since each time it's different...

I have found no other method to select that control than its position which is unique in the app.

You distorted your screenshot. That didn't help matters at all.

What more info is required? Edited by mro2

Share this post


Link to post
Share on other sites

Instance ID from the control is the same always...

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