void CTest::OnMouseMove(UINT nFlags, CPoint point)
{
CRect rect;
GetDlgItem(IDC_STATIC_ELEMENT)->GetWindowRect(rect);//得到坐标
ScreenToClient(rect);//转换为客户坐标CPoint tpt;//
tpt.x=point.x;
tpt.y=point.y;
//判断鼠标是否在元素操作区
if (rect.PtInRect(tpt))
{
...
}
}
{
CRect rect;
GetDlgItem(IDC_STATIC_ELEMENT)->GetWindowRect(rect);//得到坐标
ScreenToClient(rect);//转换为客户坐标CPoint tpt;//
tpt.x=point.x;
tpt.y=point.y;
//判断鼠标是否在元素操作区
if (rect.PtInRect(tpt))
{
...
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货