关于鼠标响应函数的问题请教
void CSyDlg::OnLButtonDown(UINT nFlags, CPoint point) {
// TODO: Add your message handler code here and/or call default
FILE *fpp;
CRectTracker RectTracker;
RECT rc;
WINDOWPLACEMENT m_Place;
if(m_bRectSelect==TRUE)
{
m_FlameWnd1.GetWindowPlacement(&m_Place);// m_FlameWnd1是当前操作的窗口
if ((point.x>=m_Place.rcNormalPosition.left)&&(point.x<m_Place.rcNormalPosition.right)&&
(point.y>=m_Place.rcNormalPosition.top)&&(point.y<m_Place.rcNormalPosition.bottom))
if (RectTracker.TrackRubberBand(this, point,FALSE))
{
m_rSelRect1.left=RectTracker.m_rect.left-m_Place.rcNormalPosition.left;
m_rSelRect1.right=RectTracker.m_rect.right-m_Place.rcNormalPosition.left;
m_rSelRect1.top=RectTracker.m_rect.top-m_Place.rcNormalPosition.top;
m_rSelRect1.bottom=RectTracker.m_rect.bottom-m_Place.rcNormalPosition.top;
m_FlameWnd1.GetClientRect(&rc);
if (m_rSelRect1.left < rc.left)
m_rSelRect1.left = rc.left;
if (m_rSelRect1.top < rc.top)
m_rSelRect1.top = rc.top;
if (m_rSelRect1.right > rc.right)
m_rSelRect1.right = rc.right;
if (m_rSelRect1.bottom > rc.bottom)
m_rSelRect1.bottom = rc.bottom;
}
}
。。。。。
}
该程序的目的是可以通过鼠标移动重新选择矩形框的位置大小,但在实际应用中,我发现鼠标移动的虚框有问题,所选择的矩形框不对,我是新手啊,麻烦各位了。