问题
Is there a Win32 API call to determine what window and/or control is visible at a certain coordinates and/or under the mouse?
回答1:
You can use GetWindowFromPoint. It will return the window handle so you can than use GetClassName function to see which control it is.
here is an example: http://support.microsoft.com/kb/112649
回答2:
Use the WindowFromPoint, ChildWindowFromPoint or ChildWindowFromPointEx Win32 functions.
来源:https://stackoverflow.com/questions/1236412/how-to-detect-what-window-control-is-at-a-specific-point-onscreen