How to detect what window/control is at a specific point onscreen?

故事扮演 提交于 2019-12-30 10:04:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!