Jump to content

Trying to get window & control positions


Recommended Posts

Hi,

I've been trying to do a small script to launch an application - I want it to select the program (fine), then click a radio button and a check box.

However, I'm not getting anywhere with ControlGetHandle or ControlGetPos - I've read the documentation examples, but am seeing errors generated.

#region ---Au3Recorder generated code Start ---
ShellExecute("C:\PathToAPP\App.exe")
Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
;$hnd = ControlGetHandle("Title as it appears in window","","[CLASS:WindowsForms10.Window.8.app.0.378734a, INSTANCE:1]")
$pos = ControlGetPos("[CLASS:WindowsForms10.Window.8.app.0.378734a]", "", "WindowsForms10.BUTTON.app.0.378734a")
MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] )

however, the output in Scite is like this:

C:\Documents and Settings\max.russell\Desktop\AutoItScript\launchGpa2SysTest.au3 (8) : ==> Subscript used with non-Array variable.:
MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] )
MsgBox(0, "Window Stats:", "POS: " & $pos^ ERROR

Is there a simpler way of doing this?

many thanks

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