2013/05/07

[C#] 폼을 마우스 드래깅으로 이동하기

private const int WM_NCHITTEST  = 0x84;
private const int HTCLIENT = 0x1;
private const int HTCAPTION = 0x2;

protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_NCHITTEST:
{
base.WndProc(ref m);
if ((int)m.Result == HTCLIENT)
{
m.Result = (IntPtr)HTCAPTION;
}
return;
}
break;
}

base.WndProc(ref m);
}




출처: http://support.microsoft.com/kb/320687/en-u

Original Post :
http://neodreamer-dev.tistory.com/704

No comments :

Post a Comment