02-20-2003, 12:24 AM
To get window size, call function GetWinXY. Function is in System\Functions\Windows folder and contains usage example.
Below is example with comments:
Declare variables:
int x y width height
Call function. Pass handle of active window (use function win to get it) and addresses of variables (use operator & to get variable address):
GetWinXY(win() &x &y &width &height)
Display variables in output:
out "x=%i y=%i width=%i height=%i" x y width height
Alternatively, you can use function GetWindowRect:
RECT r
GetWindowRect(win() &r)
out "x=%i y=%i width=%i height=%i" r.left r.top r.right-r.left r.bottom-r.top
Below is example with comments:
Declare variables:
int x y width height
Call function. Pass handle of active window (use function win to get it) and addresses of variables (use operator & to get variable address):
GetWinXY(win() &x &y &width &height)
Display variables in output:
out "x=%i y=%i width=%i height=%i" x y width height
Alternatively, you can use function GetWindowRect:
RECT r
GetWindowRect(win() &r)
out "x=%i y=%i width=%i height=%i" r.left r.top r.right-r.left r.bottom-r.top