MFC - Move Form that No Title Bar Window (Dragging a dialog by clicking anywhere on it)
1.
void CNCHitDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CDialog::OnLButtonDown(nFlags, point);
// fake windows into thinking your clicking on the caption, does not
// maximize on double click
PostMessage( WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM( point.x, point.y));
}
2.
or
UINT CNCHitDlg::OnNcHitTest(CPoint point)
{
UINT nHitTest = CDialog::OnNcHitTest( point );
// also fake windows out, but this maximizes the window when you double
// click on it.
return (nHitTest == HTCLIENT) ? HTCAPTION : nHitTest;
}
