Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public const int WM_NCLBUTTONDOWN = 0xA1;
  2. public const int HT_CAPTION = 0x2;
  3.  
  4. [System.Runtime.InteropServices.DllImport("user32.dll")]
  5. public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
  6. [System.Runtime.InteropServices.DllImport("user32.dll")]
  7. public static extern bool ReleaseCapture();
  8.  
  9. if (e.Button == MouseButtons.Left)
  10. {
  11. ReleaseCapture();
  12. SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement