Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
all child handles in a RECT
#1
Hello All,
Is there an easy way to get all the visible child window handles in a rect area? i.e. as if you child(mouse) over each pixel in the rect and got the unique set?
Thanks,
S
#2
Macro Macro2257
Code:
Copy      Help
out
int w=win("" "QM_Editor")
RECT r; SetRect &r 100 0 300 300
;_____________________

RECT rw rc ri
GetClientRect w &rw; MapWindowPoints w 0 +&rw 2 ;;client rect in screen
OffsetRect &r rw.left rw.top ;;r in screen
OnScreenRect 1 &r; 1 ;;remove this
ARRAY(int) a; int i
child "" "" w 0x400 "" a
for i 0 a.len
,GetWindowRect a[i] &rc ;;control rect in screen
,if(!IntersectRect(&ri &r &rc)) continue
,outw a[i]
,OnScreenRect 0 &ri; 0.3 ;;remove this
,
#3
What a nice piece of code!
Thanks for sharing.
#4
This is fantastic. For some reason, for larger rect's that bordered close to another child hwnd, the nearby hwnd would get included, even though it was outside the RECT. I took out the OffsetRect line, and now it works PERFECTLY.
Thank you so much!!!
S


Forum Jump:


Users browsing this thread: 1 Guest(s)