获取当前鼠标点处的窗口
2009-06-08 10:12
190 查看
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);
}
{
// 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);
}
相关文章推荐
- C#如何获取鼠标相对当前窗口的坐标
- 易语言获取当前鼠标的窗口句柄、位置、颜色值
- C#如何获取鼠标相对当前窗口的坐标(转自博客园)
- C#如何获取鼠标相对当前窗口的坐标
- C#如何获取鼠标相对当前窗口的坐标
- 解决C#获取鼠标相对当前窗口坐标的实现方法
- 易语言当前窗口或组件的窗口句柄获取方法
- jQuery获取当前鼠标相对位置坐标和点击图片跳转上一张或下一张功能
- Unity3D获取当前键盘按键及Unity3D鼠标、键盘的基本操作
- javaScript获取当前鼠标坐标值
- js获取鼠标当前所在页面位置
- jquery中获取当前鼠标的x、y位置位置
- OGRE 1.7 鼠标非独占使用(鼠标移出当前窗口)
- TForm.ShowModal只是接管消息循环,禁止外部键盘和鼠标输入到别的窗口,但并不封锁其它窗口继续获取消息(比如WM_TIMER消息仍可被发送到别的窗口上)
- WinForm中获取鼠标当前位置
- 获取当前窗口标题的方法
- 获取当前鼠标点击处的颜色值
- 手机浏览器判断,窗口宽度,获取当前页面的顶端到页面顶端的距离
- Delphi编程获取系统当前进程、窗口句柄、文件属性以(转)
- c# 获取鼠标处窗口句柄,程序嵌入桌面