void CDemoDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect myRect;
GetWindowRect(&myRect);
GetCursorPos(&point);
SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
__super::OnLButtonDown(nFlags, point);
}
void CDemoDlg::OnMouseMove(UINT nFlags, CPoint point)
{
CRect myRect;
GetWindowRect( &myRect);
CPoint curpoint;
GetCursorPos(&curpoint);
{
MoveWindow(curpoint.x - point.x, curpoint.y - point.y,
myRect.right - myRect.left, myRect.bottom - myRect.top, TRUE);
}
__super::OnMouseMove(nFlags, point);
}
This solved my problem of moving window