[WinForm]- 窗口拖动

[DllImport("user32.dll")] public static extern bool ReleaseCapture();

[DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

  private void Form_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(this.Handle, 0x0112, 0xF012, 0);
        }

 

posted @ 2013-11-29 16:22  NowhereMan  阅读(165)  评论(0)    收藏  举报