i need to get a static controls handle using the ChildWindowFromPoint function. using the WindowFromPoint doesnt work with static controls. anyways here's a snipet of what i got. im getting very strange point results.
invoke GetCursorPos,addr curPos ;get cursor postion and place info in curPos(POINT) structure
invoke WindowFromPoint,curPos.x,curPos.y ;using the points get the handle to the parent window
invoke ChildWindowFromPoint,eax,curPos.x,curPos.y ;then get the child window of parent at mouse position
mov hSpot,eax
There is not enought info given to see its fully context, but when i wrote my little 'topmost' tool i used:
To translate the point to translate the Parent window' point event to screen co-ords. (( I was also using Mouse Captures to recieve messages when off the parrent window as well ~ but this should not be an issue to your needs ))
:NaN:
invoke ClientToScreen, hWnd, addr PT
invoke WindowFromPoint, PT.x, PT.y
To translate the point to translate the Parent window' point event to screen co-ords. (( I was also using Mouse Captures to recieve messages when off the parrent window as well ~ but this should not be an issue to your needs ))
:NaN:
Yeah, in your code, Smurf, I think you need a ScreenToClient after WindowFromPoint (because ChildWindowFromPoint works on client coords)
Regards
eGo
Regards
eGo
thanks guys. ScreenToClient was what i was looking for. i had given it a try already along with every other point convertion but i must have overlooked something.