Posted By

wearetherock on 11/20/09


Tagged

c move


Versions (?)

Move without Title


 / Published in: C#
 

  1. // Declair
  2. public const int WM_NCLBUTTONDOWN = 0xA1;
  3. public const int HT_CAPTION = 0x2;
  4.  
  5. [DllImportAttribute("user32.dll")]
  6. public static extern int SendMessage(IntPtr hWnd,int Msg, int wParam, int lParam);
  7.  
  8. [DllImportAttribute("user32.dll")]
  9. public static extern bool ReleaseCapture();
  10.  
  11.  
  12. // Use
  13. private void AgentForm_MouseDown(object sender, MouseEventArgs e){
  14. if (e.Button == MouseButtons.Left){
  15. ReleaseCapture();
  16. SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
  17. }
  18. }
  19. }

Report this snippet  

You need to login to post a comment.