展开全部
void C********::OnMouseMove(UINT nFlags, CPoint point)
{
ClientToScreen(&point);
CRect rect;
GetDlgItem(图像控件ID)->GetClientRect(rect);
GetDlgItem(图像控件ID)->ClientToScreen(rect);
if(rect.PtInRect(point) ) //鼠标是否在控件范围之内
{
}
CDialog::OnMouseMove(nFlags, point);
}
{
ClientToScreen(&point);
CRect rect;
GetDlgItem(图像控件ID)->GetClientRect(rect);
GetDlgItem(图像控件ID)->ClientToScreen(rect);
if(rect.PtInRect(point) ) //鼠标是否在控件范围之内
{
}
CDialog::OnMouseMove(nFlags, point);
}
展开全部
bool ck=true;POINT pt;
void CMfccsDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
RECT rect;
::GetWindowRect(GetDlgItem(IDC_STATIC1)->m_hWnd,&rect);
GetCursorPos(&pt);
if((pt.x<rect.left||pt.x>rect.right||pt.y<rect.top||pt.y>rect.bottom)&&ck)
{
MessageBox("移出");
ck=false;
}
else
ck=true;
CDialog::OnMouseMove(nFlags, point);
}
void CMfccsDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
RECT rect;
::GetWindowRect(GetDlgItem(IDC_STATIC1)->m_hWnd,&rect);
GetCursorPos(&pt);
if((pt.x<rect.left||pt.x>rect.right||pt.y<rect.top||pt.y>rect.bottom)&&ck)
{
MessageBox("移出");
ck=false;
}
else
ck=true;
CDialog::OnMouseMove(nFlags, point);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询