您的位置:首页 > 其它

如何判断鼠标进入了一个窗口

2011-01-26 16:08 357 查看
响应鼠标的MOUSE_MOVE消息

void CAscPatchDlg::OnMouseMove(UINT nFlags, CPoint point) // point是客户区坐标

{

// TODO: Add your message handler code here and/or call default

CRect rect;

GetWindowRect(rect); // GetWindowRect获取的是屏幕坐标

ScreenToClient(rect); // 需要转换成客户区坐标

if (PtInRect(&rect, point))

{

OutputDebugString("in rect");

}

CDialog::OnMouseMove(nFlags, point);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: