Window.Position
Definition
- Repositions and/or resizes target window according to values specified.
- New size & position values may be keywords, a positive or negative number (in quotes), or the equals sign.
Syntax
- Window.Position(x, y, w, h, cl)
Parameters
- x
- (string) x-coordinate of window
- y
- (string) y-coordinate of window
- w
- (string) width of window
- h
- (string) height of window
- cl
- (mixed) caption list identifying target window(s)
Keywords for x, y, w, h
- "="
- keep current value
- "+"
- prepended to the value
- value is calculated relative to current position
- "center"
- window is centred on screen
- "hmax"
- maximum height
- "wmax"
- maximum width
Examples
- Window.Position("=", "=", "300", "200", "active")
Window.Position("= = 300 200", "active")
Window.Position("= = 300 200 active")
Window.Position("=", "= 300", "200 active")- Resizes active window to 300x200.
- Note that each of the Window.Position() calls here has the same effect.
PowerPro accepts any combination of the 5 parameters as separate strings in the Window.Position() call:- 5 separate string values
- a single string containing 5 space-separated values
- 2, 3, or 4 comma-separated strings, each containing a number of space-separated values
- Window.Position("0", "0", "=", "hmax/2", "=notepad")
- Moves notepad to top left corner of screen & resizes it to half maximum height.
- Window.Position("+-50", "+-80", "=", "=", "active")
- Moves active window 50px left and 80px up.
- Window.Position("++100", "++150", "=", "=", "active")
- Moves active window 100px right and 150px down.
- Window.Position("++100 ++150 = = active")
- This has the same effect as the above example, but it is written differently, with all parameters given in a single space-separated string.
Notes
- See the Win plugin for other ways to resize & move windows.