Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by [EMAIL PROTECTED]

http://bugzilla.ximian.com/show_bug.cgi?id=79378

--- shadow/79378        2006-09-12 05:24:00.000000000 -0400
+++ shadow/79378.tmp.17594      2006-09-12 05:24:00.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 79378
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Prevent a user from moving a form during runtime doesn't work
+
+Trying to prevent a user from moving a form during runtime with an
+overriden WndProc doesn't work. The form can still be moved.
+
+Test case:
+
+using System;
+using System.Windows.Forms;
+
+namespace WinDontMove
+{
+       public class MainForm : Form
+       {
+               protected override void WndProc( ref Message m ) 
+               { 
+                       const int WM_NCLBUTTONDOWN = 161; 
+                       const int WM_SYSCOMMAND = 274; 
+                       const int HTCAPTION = 2; 
+                       const int SC_MOVE = 61456; 
+
+                       if ( (m.Msg == WM_SYSCOMMAND) && (m.WParam.ToInt32() == 
SC_MOVE) ) 
+                               return; 
+                       if ( (m.Msg == WM_NCLBUTTONDOWN) && (m.WParam.ToInt32() 
== HTCAPTION) ) 
+                               return; 
+
+                       base.WndProc( ref m ); 
+               }  
+
+               [STAThread]
+               static void Main() 
+               {
+                       Application.Run(new MainForm());
+               }
+       }
+}
+
+Found at Windows Forms FAQ forums.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to