Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger macro for controls on a window
#23
ok, where is my error here???
Function detect_mouse_clicks_in_window_58736
Code:
Copy      Help
function hwndTB
;int hwndOwner=GetToolbarOwner(hwndTB)
ARRAY(RECT) a
SetRect &a[] 110 77 403 96
SetRect &a[] 110 229 403 248
SetRect &a[] 411 252 516 277
SetRect &a[] 411 283 516 308
SetRect &a[] 411 314 516 339
SetRect &a[] 595 41 612 58
SetRect &a[] 587 43 770 348
SetRect &a[] 595 251 700 276
SetRect &a[] 595 283 700 308
SetRect &a[] 595 315 700 340


int x y
rep
,wait 0 ML
,if(!IsWindow(hwndTB)) ret
,if(win!hwndTB) continue
,Acc b.FromMouse; err continue
,POINT p; xm(p 0 1) ;;get mouse position into p.x and p.y
,sub.InRect(a hwndTB p.x p.y)
,;out name

#sub InRect
function ARRAY(RECT)&a int'u int'x int'y
int i
for i 0 a.len
,RECT& r=a[i]
,;outRECT r
,if(PtInRect(&r x y))
,,out 1


never output 1...
grrrrr


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)