代码如下。怎样改才能像右下角的Gripper改变窗口大小效果?
void CStatusBarEx::OnMouseMove(UINT nFlags, CPoint point)
{
CRect rect1;
GetClientRect(&rect1);
if(point.x >= rect1.right - 40 && point.x <= rect1.right - 20 && point.y >= rect1.top && point.y <= rect1.bottom)
{
m_bMouseEntered = TRUE;
SetCursor(m_hCursor);
if(m_bMousePressed)
{
CWnd* pWnd = AfxGetApp()->GetMainWnd();
if(pWnd && pWnd->GetSafeHwnd())
{
CRect rect1;
pWnd->GetWindowRect(&rect1);
rect1.right += (point.x - m_point.x);
rect1.bottom += (point.y - m_point.y);
pWnd->MoveWindow(&rect1);
pWnd->UpdateWindow();
m_point = point;
}
}
}
CStatusBar::OnMouseMove(nFlags, point);
}
void CStatusBarEx::OnLButtonDown(UINT nFlags, CPoint point)
{
m_bMousePressed = TRUE;
if(m_bMouseEntered)
{
SetCursor(m_hCursor);
m_point = point;
}
CStatusBar::OnLButtonDown(nFlags, point);
}
void CStatusBarEx::OnLButtonUp(UINT nFlags, CPoint point)
{
if(m_bMouseEntered)
{
SetCursor(m_hCursor);
m_point = point;
}
CStatusBar::OnLButtonUp(nFlags, point);
}
------解决方案--------------------------------------------------------
http://blog.csdn.net/visualeleven/article/details/6223577