void CGetWndDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CWnd *pWnd=WindowFromPoint(point);
if(AfxIsValidAddress(pWnd,sizeof(CWnd)))
{
if(::IsChild(m_hWnd,pWnd->m_hWnd))
{
CString str;
pWnd->GetWindowText(str);
SetWindowText(str);
}
}
CDialog::OnMouseMove(nFlags, point);
}
BOOL CGetWndDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_MOUSEMOVE)
{
CPoint point(LOWORD(pMsg->lParam),HIWORD(pMsg->lParam));
::ClientToScreen(pMsg->hwnd,&point);
OnMouseMove(0,point);
}
return CDialog::PreTranslateMessage(pMsg);
}