Move without Title


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.