在 MFC(Microsoft Foundation Classes)中,CWnd::ChildWindowFromPoint 不是 CWnd 类的公共方法。实际上,这是 Windows API 中的一个函数,用于检索指定点下的子窗口的句柄。

以下是 ChildWindowFromPoint 函数的原型:
HWND ChildWindowFromPoint(HWND hWndParent, POINT Point);

  •  hWndParent 是父窗口的句柄。

  •  Point 是一个结构,包含要检查的点的坐标。


如果你想在 MFC 中使用这个功能,你可以在 CWnd 对象上调用 Windows API 函数 ::ChildWindowFromPoint,如下所示:
CPoint point; // 设置你要检查的点的坐标
HWND hWndChild = ::ChildWindowFromPoint(m_hWnd, point);

在这里,m_hWnd 是父窗口的句柄,point 是要检查的点的坐标。hWndChild 将包含位于指定点下的子窗口的句柄。

请注意,在使用此函数时,可能需要根据具体情况处理返回的句柄。


转载请注明出处:http://www.pingtaimeng.com/article/detail/23265/MFC/CWnd