Hi,
I developed a small application where I converted the client mouse messages to non-client mouse messages. Here is how I did it :
void CMoveWinView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_fDragging=TRUE;
AfxGetMainWnd()->SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,0);
CView::OnLButtonDown(nFlags, point);
}
void CMoveWinView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_fDragging)
AfxGetMainWnd()->SendMessage(WM_NCMOUSEMOVE,HTCAPTION,0);
CView::OnMouseMove(nFlags, point);
}
void CMoveWinView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_fDragging=FALSE;
AfxGetMainWnd()->SendMessage(WM_NCLBUTTONUP,HTCAPTION,0);
CView::OnLButtonUp(nFlags, point);
}
The problem is that it worked fine !!!
I passed the mouse co-ordinates as 0 in SendMessage but still the frame window is moved correctly when we drag in client area!!
Any of the brainy code gurus out there .... please explain!!
Vishal
