Author: toshok
Date: 2007-03-07 16:40:28 -0500 (Wed, 07 Mar 2007)
New Revision: 73910

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
Log:
2007-03-07  Chris Toshok  <[EMAIL PROTECTED]>

        * XplatUIWin32.cs: create InternalWndProc so that we're guaranteed
        to be called before NativeWindow.WndProc.  Put the HwndCreating
        magic there to hook up our Hwnd's to handles.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-07 21:29:00 UTC (rev 73909)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-07 21:40:28 UTC (rev 73910)
@@ -1,3 +1,9 @@
+2007-03-07  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * XplatUIWin32.cs: create InternalWndProc so that we're guaranteed
+       to be called before NativeWindow.WndProc.  Put the HwndCreating
+       magic there to hook up our Hwnd's to handles.
+
 2007-03-07  Gert Driesen  <[EMAIL PROTECTED]>
 
        * DataGridView.cs: Comment out debug code.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-03-07 21:29:00 UTC (rev 73909)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-03-07 21:40:28 UTC (rev 73910)
@@ -763,7 +763,7 @@
 
                        themes_enabled = false;
 
-                       wnd_proc = new WndProc(NativeWindow.WndProc);
+                       wnd_proc = new WndProc(InternalWndProc);
 
                        
FosterParent=Win32CreateWindow((int)WindowExStyles.WS_EX_TOOLWINDOW, "static", 
"Foster Parent Window", (int)WindowStyles.WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, 
IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
 
@@ -1535,9 +1535,14 @@
                                          SetWindowPosFlags.SWP_DRAWFRAME);
                }
 
+               private IntPtr InternalWndProc (IntPtr hWnd, Msg msg, IntPtr 
wParam, IntPtr lParam)
+               {
+                       if (HwndCreating != null && HwndCreating.ClientWindow 
== IntPtr.Zero)
+                               HwndCreating.ClientWindow = hWnd;
+                       return NativeWindow.WndProc (hWnd, msg, wParam, lParam);
+               }
+
                internal override IntPtr DefWndProc(ref Message msg) {
-                       if (HwndCreating != null && HwndCreating.ClientWindow 
!= IntPtr.Zero)
-                               HwndCreating.ClientWindow = msg.HWnd;
                        msg.Result=Win32DefWindowProc(msg.HWnd, (Msg)msg.Msg, 
msg.WParam, msg.LParam);
                        return msg.Result;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to