« November 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
You are not logged in. Log in

Programming Tips
Friday, 18 November 2005
To move a captionless dialog.
Mood:  mischievious
Topic: VC++
Have you ever wondered how do people move dialogs by simply clicking anywhere inside the dialog and dragging them. 
Have you ever wondered how captionless dialogs can be dragged arround.

If it is so then let me tell you that you can do the same with just one line of code.

Here goes the code:

void CNCHitTestProDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
        //here is the code
        SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
        CDialog::OnLButtonDown(nFlags, point);
}

Posted by Nibu babu thomas at 5:04 PM
Updated: Friday, 18 November 2005 5:07 PM

View Latest Entries