Jump to content
Sign in to follow this  

Trying to get window & control positions

Recommended Posts



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 ---
;$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

Share this post

Link to post
Share on other sites


If Not @error Then MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] )

A parameter may be wrong...

AutoIt X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.