15,976
社区成员
发帖
与我相关
我的任务
分享BOOL CXXDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(WM_MOUSEMOVE == pMsg->message)
{
CPoint point;
GetCursorPos(&point);
CWnd* pWnd = WindowFromPoint(point);
if(pWnd)
{
CString strText(_T(""));
pWnd->GetWindowText(strText);
SetDlgItemText(IDC_STATIC1, strText);
}
}
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CXXXDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(WM_MOUSEMOVE == pMsg->message)
{
CPoint point;
GetCursorPos(&point);
CWnd* pWnd = WindowFromPoint(point);
if(pWnd)
{
CString strText(_T(""));
pWnd->GetWindowText(strText);
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_STATIC1);
CRect rc;
pEdit->GetWindowRect(rc);
ScreenToClient(rc);
InvalidateRect(&rc);
pEdit->SetWindowText(strText);
}
}
return CDialog::PreTranslateMessage(pMsg);
}