Here is a template for multi-monitor system to manipulate windows. Hope it to 
be helpful to others.

===========================================
MONITOR_NUM = win.getsystemmetrics(80)

//get active window handle
cl = win.handle("active")

if(win.exists(cl)==0)
quit
if(win.fullscreen(1)==1)
quit

//9 monitors max
v_rect_scr = vec.create(9)

for(count = 0; count < MONITOR_NUM; count=count + 1)
  v_rect_scr[count]=win.getdisplayrect(count,1)
endfor

//
v_rect_scr_point = vec.create2D(9,4)
v_temp = vec.create(4)

for(count = 0; count < MONITOR_NUM; count = count +1)
    left_rect = find(v_rect_scr[count], " ")
    top_rect = find(v_rect_scr[count], " ", left_rect+1)
    right_rect = find(v_rect_scr[count], " ", top_rect+1)
    bottom_rect = find(v_rect_scr[count], " ", right_rect+1)
    v_temp[0]= slice(v_rect_scr[count], 0,left_rect-1)
    v_temp[1]= slice(v_rect_scr[count],left_rect+1, top_rect-1)
    v_temp[2]= slice(v_rect_scr[count], top_rect+1, right_rect-1)
    v_temp[3] = slice(v_rect_scr[count], right_rect+1, bottom_rect-1)
    for(i =0; i<4; i=i+1)
      v_rect_scr_point[count,i] = v_temp[i]
    endfor
endfor

//

win.restore(cl)

rect = win.getrect(cl)
left = win.left(cl)
right = win.right(cl)
top = win.top(cl)
bottom = win.bottom(cl)
x_center = (left+right)/2
y_center = top

pos = 0
for(count =0; count <MONITOR_NUM; count = count + 1)
 
  if((x_center >= v_rect_scr_point[count,0]) and (x_center <= 
v_rect_scr_point[count,2])) do
    if((y_center >= v_rect_scr_point[count,1]) and (y_center <= 
v_rect_scr_point[count,3])) do
      pos = count
      jump RESIZE
    endif
  endif
endfor

@RESIZE
A = (v_rect_scr_point[pos,2]-v_rect_scr_point[pos,0])*7/10
r = win.makerect(v_rect_scr_point[pos,0], v_rect_scr_point[pos,1], 
v_rect_scr_point[pos,0]+A, v_rect_scr_point[pos,3])

win.setrect(cl, r)

//free mem
v_rect_scr_point.deleteall
v_rect_scr.deleteall
v_temp.deleteall







Reply via email to