Advertisement
Ewwe

Form Mover

Nov 24th, 2012
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System.Runtime.InteropServices;
  2.  
  3. [DllImportAttribute("user32.dll")]
  4. public static extern int SendMessage(IntPtr hWnd,
  5.                  int Msg, int wParam, int lParam);
  6. [DllImportAttribute("user32.dll")]
  7. public static extern bool ReleaseCapture();
  8.  
  9. private void Form1_MouseDown(object sender,
  10.         System.Windows.Forms.MouseEventArgs e)
  11. {    
  12.     if (e.Button == MouseButtons.Left)
  13.     {
  14.         ReleaseCapture();
  15.         SendMessage(Handle, 0xA1, 0x2, 0);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement