15,979
社区成员
发帖
与我相关
我的任务
分享
// CMyStatic message handlers
void CMyStatic::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
static CPoint ptLast;
//
if(MK_LBUTTON==nFlags)
{
CRect rc;
GetWindowRect(&rc);
ScreenToClient(&rc);
MapWindowPoints(GetParent(),&rc);
MoveWindow(rc.left+(point.x-ptLast.x), rc.top+(point.y-ptLast.y), rc.Width(), rc.Height());
}
else
{
ptLast=point;
CStatic::OnMouseMove(nFlags, point);
}
Invalidate();
}