Posts: 1,006
	Threads: 330
	Joined: Mar 2007
	
	
 
	
	
		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
	
	
	
	
	
 
 
	
	
	
		
	Posts: 12,239
	Threads: 144
	Joined: Dec 2002
	
	
 
	
	
		Macro 
Macro2257 
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
,
 
 
	
	
	
		
	Posts: 135
	Threads: 33
	Joined: Aug 2009
	
	
 
	
	
		What a nice piece of code!
Thanks for sharing.
	
	
	
	
	
 
 
	
	
	
		
	Posts: 1,006
	Threads: 330
	Joined: Mar 2007
	
	
 
	
	
		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