Take disabled windows into account in wxFindWindowAtPoint() in wxMSW.

Use ChildWindowFromPointEx(CWP_SKIPINVISIBLE) to ensure that we find the
disabled children (by not using CWP_SKIPDISABLED).

Add a unit test to check for the correct behaviour in all cases and document
it.

Closes #2942.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-03-04 00:29:17 +00:00
parent 7cd60fb938
commit e18a74e240
3 changed files with 60 additions and 1 deletions

View File

@@ -7205,6 +7205,14 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
pt2.y = pt.y;
HWND hWnd = ::WindowFromPoint(pt2);
if ( hWnd )
{
// WindowFromPoint() ignores the disabled children but we're supposed
// to take them into account, so check if we have a child at this
// coordinate.
::ScreenToClient(hWnd, &pt2);
hWnd = ::ChildWindowFromPointEx(hWnd, pt2, CWP_SKIPINVISIBLE);
}
return wxGetWindowFromHWND((WXHWND)hWnd);
}