Click to See Complete Forum and Search --> : Forcing a user to drop during a drag


James Spibey
June 10th, 1999, 07:40 AM
Hi,

I am trying to find a way to cause a user to drop the main window while it is being dragged under certain conditions.

I use the following code to allow the user to drag the window by clicking anywhere on the dialog.

void CMyWin::OnLButtonDown(UINT nFlags, CPoint point)
{
PostMessage( WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM( point.x, point.y));
CDialog::OnLButtonDown(nFlags, point);
}



to make them drop it I tried this:

void CMyWin::OnMouseMove(UINT nFlags, CPoint point)
{
if(bDrop)
SendMessage( WM_NCLBUTTONUP, HTCAPTION, MAKELPARAM( point.x, point.y));

CDialog::OnMouseMove(nFlags, point);
}



I also tried to send a plain WM_LBUTTONUP and that didn't work either.

Does anyone have any ideas?

Cheers

James