Jump to content

get handle for control with x/y position not working


mro2
 Share

Recommended Posts

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

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

Link to comment
Share on other sites

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

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
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...