Sign in to follow this  
Followers 0
Alan S

WinMove syntax?

5 posts in this topic

Hi all,

I'm very new to scripting in general and AutoIt3 in particular. I've got a syntax problem that is foxing me, and I just can't see it. I've searched the Help file, and this forum, to no avail.

Basically, I'm saving a window size, resizing the window, then later resetting it. The following code shows the things I've tried:

#include <Array.au3>
Dim $WSArray [2]
;
; Open application here with RUN function
WinWaitActive ("Window Title")
;
;save window size for later
$WSArray = WinGetClientSize ("")
;
;display window size
_ArrayDisplay( $WSArray, "Window Size" )
;
; set new window size
WinMove ("","",0,0,1024,738)
sleep(1000)
;
; now reset window size
; first attempt fails: Error in Expression
WinMove ("Window Title","",0,0,$WSArray(0),$WSArray(1))
;
; second try - convert to number? Same error occurs
WinMove ("Window Title","",0,0, number($WSArray(0)), number($WSArray(1)))
;
; Help?

The $WSArray contains numbers, as shown by the _ArrayDisplay function, so I'm not sure why WinMove is barfing on either version of the code... all help gratefully received.

Thanks,

AlaN S>

Share this post


Link to post
Share on other sites



use [ ] instead of () for arrays

#include <Array.au3>
Dim $WSArray [2]
$title = "Untitled - Notepad"
;
; Open application here with RUN function
WinWaitActive ($title)
;
;save window size for later
$WSArray = WinGetClientSize ($title)
;
;display window size
_ArrayDisplay( $WSArray, "Window Size" )
;
; set new window size
WinMove ($title,"",0,0,1024,738)
sleep(1000)
;
; now reset window size
; first attempt fails: Error in Expression
WinMove ($title,"",0,0,$WSArray[0],$WSArray[1])
;
; second try - convert to number? Same error occurs
WinMove ($title,"",0,0, number($WSArray[0]), number($WSArray[1]))

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Doh! Just call me Homer.

I said I couldn't see it, didn't I?

very many thanks..

Share this post


Link to post
Share on other sites

Like you, I'm new to all this - Use the SciTe editor! Worth it's weight in gold!


The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched.

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