You get better values (ie non 65535 values when expanding), if you dont use memblocks, just allocate memory, and then peek.
The reason the 65535 appears is a) a problem with memblocks and b) Windows moves the window when expanding (to produce a negative x,y position).
So, the proper code is :
sync on
set window on
load dll "user32.dll",1
hwnd = call dll(1,"GetActiveWindow")
ptr=calloc(63)
set text size 20
do
cls
retval=call dll(1,"GetWindowRect",hwnd,ptr)
text 0,0,"X1="+str$(peekl(ptr,0))
text 0,20,"Y1="+str$(peekl(ptr,4))
text 0,40,"X2="+str$(peekl(ptr,8))
text 0,60,"Y2="+str$(peekl(ptr,12))
sync
loop
and yes, you will need my plug-ins to run it.