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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user