Sign in to follow this  
Followers 0
MaxRussell

Trying to get window & control positions

2 posts in this topic

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

Share this post


Link to post
Share on other sites



Try

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

A parameter may be wrong...


AutoIt 3.3.14.2 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  
Followers 0