in OnLButtonDown you call ::SetCapture()and in OnLButtonUp you call ::ReleaseCapture().
So you get all Mouse Messages while the capture is set
For example:
MyClass::OnLButtonDown(UINT nFlags,CPoint point)
{
::SetCapture(this->m_hWnd);
}
MyClass::OnLButtonUp(UINT nFlags,CPoint point )
{
::ReleaseCapture();
}
MyClass::OnMouseMove(UINT nFlags, CPoint point)
{
}
Or see
here[
^].