Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window size
#1
:?
im trying to get the window size of the act window but im having problems.
i thought i could use this to get it

function# hwnd *x *y [*width] [*height]
outp x
'Y
outp y
'Y
outp width
'Y
outp height

but my outputs are 0 0 0 0 respectivly... can anyone offer a suggestion?
ps: i used to use

var1 = width
var2 = height
etc.

thanks.
#2
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
#3
wow...thats hard core.
works great now! Tongue


Forum Jump:


Users browsing this thread: 1 Guest(s)