Index: trunk/src/user32/defwndproc.cpp
===================================================================
--- trunk/src/user32/defwndproc.cpp	(revision 4190)
+++ trunk/src/user32/defwndproc.cpp	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: defwndproc.cpp,v 1.13 2000-02-16 14:34:15 sandervl Exp $ */
+/* $Id: defwndproc.cpp,v 1.14 2000-09-05 19:20:33 sandervl Exp $ */
 
 /*
@@ -32,4 +32,5 @@
   Win32BaseWindow *window;
 
+    dprintf2(("DefWindowProcA %x %x %x %x", hwnd, Msg, wParam, lParam));
     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
@@ -45,4 +46,5 @@
   Win32BaseWindow *window;
 
+    dprintf2(("DefWindowProcW %x %x %x %x", hwnd, Msg, wParam, lParam));
     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
Index: trunk/src/user32/pmwindow.cpp
===================================================================
--- trunk/src/user32/pmwindow.cpp	(revision 4190)
+++ trunk/src/user32/pmwindow.cpp	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.102 2000-09-01 01:36:15 phaller Exp $ */
+/* $Id: pmwindow.cpp,v 1.103 2000-09-05 19:20:34 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -377,11 +377,4 @@
         }
 
-        if(pswp->fl & SWP_ACTIVATE)
-        {
-             if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE)) {
-             	WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd);
-	     }
-        }
-
         if((pswp->fl & (SWP_MOVE | SWP_SIZE)) && !(win32wnd->getStyle() & WS_MINIMIZE_W))
         {
@@ -458,4 +451,11 @@
         }
 
+        if(pswp->fl & SWP_ACTIVATE)
+        {
+             if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE)) {
+             	WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd);
+	     }
+        }
+
 PosChangedEnd:
         RestoreOS2TIB();
@@ -590,4 +590,135 @@
     }
 
+    //is sent to both windows gaining and loosing the focus
+    case WM_FOCUSCHANGE:
+    {
+     HWND   hwndFocus = (HWND)mp1;
+     HWND   hwndLoseFocus, hwndGainFocus;
+     USHORT usSetFocus = SHORT1FROMMP(mp2);
+     USHORT fsFocusChange = SHORT2FROMMP(mp2);
+
+        rc = 0;
+        dprintf(("OS2: WM_FOCUSCHANGE (start) %x %x %x %x", win32wnd->getWindowHandle(), hwndFocus, usSetFocus, fsFocusChange));
+        RestoreOS2TIB();
+	if(usSetFocus) {
+		hwndGainFocus = hwnd;
+		hwndLoseFocus = hwndFocus;
+	}
+	else {
+		hwndGainFocus = hwndFocus;
+		hwndLoseFocus = hwnd;
+	}
+      
+        if(usSetFocus)
+        {
+          Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus);
+          if(!(fsFocusChange & FC_NOSETACTIVE))
+          {
+            if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 
+            {
+              if(winfocus)
+                WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
+              else	
+                WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
+            }
+          }
+          //SvL: Check if window is still valid
+          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
+          if(win32wnd == NULL)
+            return (MRESULT)rc;
+
+          if(!(fsFocusChange & FC_NOSETACTIVE))
+          {
+            Win32BaseWindow *topparent = win32wnd->GetTopParent();
+            if(!winfocus || (winfocus->GetTopParent() != topparent))
+            {
+              if(!(fsFocusChange & FC_NOBRINGTOTOP))
+              {
+                if(topparent) {
+                  //put window at the top of z order
+                  WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
+                }
+              }
+  
+              // PH 2000/09/01 Netscape 4.7
+              // check if topparent is valid
+              if (topparent)
+                WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
+            }
+          }
+          //SvL: Check if window is still valid
+          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
+          if(win32wnd == NULL)
+            return (MRESULT)rc;
+
+	  //TODO: Don't send WM_SETSELECTION to child window if frame already has selection
+	  if(!(fsFocusChange & FC_NOSETSELECTION)) {
+       		WinSendMsg(hwndGainFocus, WM_SETSELECTION, (MPARAM)1, (MPARAM)0);
+	  }
+
+	  if(!(fsFocusChange & FC_NOSETFOCUS)) {
+       		WinSendMsg(hwndGainFocus, WM_SETFOCUS, (MPARAM)hwndLoseFocus, (MPARAM)1);
+	  }
+        }
+        else /* no usSetFocus */
+        {
+	  if(!(fsFocusChange & FC_NOLOSEFOCUS)) {
+       	 	WinSendMsg(hwndLoseFocus, WM_SETFOCUS, (MPARAM)hwndGainFocus, (MPARAM)0);
+	  }
+	  //TODO: Don't send WM_SETSELECTION to child window if frame already has selection
+  	  if(!(fsFocusChange & FC_NOLOSESELECTION)) {
+       		WinSendMsg(hwndLoseFocus, WM_SETSELECTION, (MPARAM)0, (MPARAM)0);
+	  }
+          //SvL: Check if window is still valid
+          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
+          if(win32wnd == NULL) {
+                return (MRESULT)rc;
+          } 
+
+          Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus);
+          if(!(fsFocusChange & FC_NOLOSEACTIVE)) 
+          {
+            Win32BaseWindow *topparent = win32wnd->GetTopParent();
+            
+            if(!winfocus || (winfocus->GetTopParent() != topparent))
+            {
+              // PH 2000/09/01 Netscape 4.7
+              // check if topparent is valid
+              if (topparent)
+                WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
+            }
+          }
+          //SvL: Check if window is still valid
+          win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
+          if(win32wnd == NULL)
+            return (MRESULT)rc;
+  
+          if(!(fsFocusChange & FC_NOSETACTIVE)) 
+          {
+            if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 
+            {
+              if(winfocus)
+              {
+                // PH 2000/09/01 Netscape 4.7
+                // check if topparent is valid
+                Win32BaseWindow *topparent = winfocus->GetTopParent();
+                if (topparent)
+                  WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
+              }
+              else	
+                WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
+            }
+          }
+        }
+      
+      
+#ifdef DEBUG
+      	SetWin32TIB();
+        dprintf(("OS2: WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2));
+      	RestoreOS2TIB();
+#endif
+        return (MRESULT)rc;
+    }
+
     //**************************************************************************
     //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen
@@ -753,128 +884,4 @@
     }
 #endif
-
-    case WM_FOCUSCHANGE:
-    {
-     HWND   hwndFocus = (HWND)mp1;
-     HWND   hwndLoseFocus, hwndGainFocus;
-     USHORT usSetFocus = SHORT1FROMMP(mp2);
-     USHORT fsFocusChange = SHORT2FROMMP(mp2);
-
-        dprintf(("OS2: WM_FOCUSCHANGE (start) %x %x %x %x", win32wnd->getWindowHandle(), hwndFocus, usSetFocus, fsFocusChange));
-        RestoreOS2TIB();
-	if(usSetFocus) {
-		hwndGainFocus = hwnd;
-		hwndLoseFocus = hwndFocus;
-	}
-	else {
-		hwndGainFocus = hwndFocus;
-		hwndLoseFocus = hwnd;
-	}
-	if(!(fsFocusChange & FC_NOLOSEFOCUS)) {
-       		WinSendMsg(hwndLoseFocus, WM_SETFOCUS, (MPARAM)hwndGainFocus, (MPARAM)0);
-	}
-	//TODO: Don't send WM_SETSELECTION to child window if frame already has selection
-	if(!(fsFocusChange & FC_NOLOSESELECTION)) {
-       		WinSendMsg(hwndLoseFocus, WM_SETSELECTION, (MPARAM)0, (MPARAM)0);
-	}
-        //SvL: Check if window is still valid
-        win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
-        if(win32wnd == NULL) {
-                return (MRESULT)rc;
-        } 
-      
-      
-      if(usSetFocus)
-      {
-        Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus);
-        if(!(fsFocusChange & FC_NOLOSEACTIVE))
-        {
-          if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 
-          {
-            if(winfocus)
-              WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
-            else	
-              WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
-          }
-        }
-        //SvL: Check if window is still valid
-        win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
-        if(win32wnd == NULL)
-          return (MRESULT)rc;
-
-        if(!(fsFocusChange & FC_NOSETACTIVE))
-        {
-          Win32BaseWindow *topparent = win32wnd->GetTopParent();
-          if(!winfocus || (winfocus->GetTopParent() != topparent))
-          {
-            if(!(fsFocusChange & FC_NOBRINGTOTOP))
-            {
-              if(topparent) {
-                //put window at the top of z order
-                WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
-              }
-            }
-
-            // PH 2000/09/01 Netscape 4.7
-            // check if topparent is valid
-            if (topparent)
-              WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
-          }
-        }
-      }
-      else /* no usSetFocus */
-      {
-        Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus);
-        if(!(fsFocusChange & FC_NOLOSEACTIVE)) 
-        {
-          Win32BaseWindow *topparent = win32wnd->GetTopParent();
-          
-          if(!winfocus || (winfocus->GetTopParent() != topparent))
-          {
-            // PH 2000/09/01 Netscape 4.7
-            // check if topparent is valid
-            if (topparent)
-              WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
-          }
-        }
-        //SvL: Check if window is still valid
-        win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
-        if(win32wnd == NULL)
-          return (MRESULT)rc;
-
-        if(!(fsFocusChange & FC_NOSETACTIVE)) 
-        {
-          if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 
-          {
-            if(winfocus)
-            {
-              // PH 2000/09/01 Netscape 4.7
-              // check if topparent is valid
-              Win32BaseWindow *topparent = winfocus->GetTopParent();
-              if (topparent)
-                WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
-            }
-            else	
-              WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
-          }
-        }
-      }
-      
-      
-	//TODO: Don't send WM_SETSELECTION to child window if frame already has selection
-	if(!(fsFocusChange & FC_NOSETSELECTION)) {
-       		WinSendMsg(hwndGainFocus, WM_SETSELECTION, (MPARAM)1, (MPARAM)0);
-	}
-
-	if(!(fsFocusChange & FC_NOSETFOCUS)) {
-       		WinSendMsg(hwndGainFocus, WM_SETFOCUS, (MPARAM)hwndLoseFocus, (MPARAM)1);
-	}
-#ifdef DEBUG
-      	SetWin32TIB();
-        dprintf(("OS2: WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2));
-      	RestoreOS2TIB();
-#endif
-        return (MRESULT)rc;
-    }
 
     case WM_QUERYTRACKINFO:
Index: trunk/src/user32/win32class.cpp
===================================================================
--- trunk/src/user32/win32class.cpp	(revision 4190)
+++ trunk/src/user32/win32class.cpp	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: win32class.cpp,v 1.17 2000-06-13 21:26:29 sandervl Exp $ */
+/* $Id: win32class.cpp,v 1.18 2000-09-05 19:20:35 sandervl Exp $ */
 /*
  * Win32 Window Class Managment Code for OS/2
@@ -425,8 +425,4 @@
  ULONG rc;
 
-  if(classNameA) {
-    dprintf2(("Win32WndClass::setClassLongA %s: %d %x", classNameA, index, lNewVal));
-  }
-  else  dprintf2(("Win32WndClass::setClassLongA %d: %d %x", classAtom, index, lNewVal));
   switch(index) {
         case GCL_CBCLSEXTRA: //TODO (doesn't affect allocated classes, so what does it do?)
@@ -467,4 +463,9 @@
                 break;
         case GCL_WNDPROC:
+		//Note: Type of SetWindowLong determines new window proc type
+                //      UNLESS the new window proc has already been registered
+                //      (use the old type in that case)
+                //      (VERIFIED in NT 4, SP6)
+		//TODO: Is that also true for GCL_WNDPROC???????????????
                 rc = (LONG)WINPROC_GetProc(windowProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A );
                 WINPROC_SetProc((HWINDOWPROC *)&windowProc, (WNDPROC)lNewVal, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_CLASS );
@@ -477,9 +478,18 @@
                         rc = userClassLong[index];
                         userClassLong[index] = lNewVal;
-                        return(rc);
+                        break;
                 }
                 SetLastError(ERROR_INVALID_PARAMETER);
+  		if(classNameA) {
+        	      dprintf2(("WARNING: Win32WndClass::setClassLongA %s: %d %x -> wrong INDEX", classNameA, index, lNewVal));
+  		}
+  		else  dprintf2(("WARNING: Win32WndClass::setClassLongA %d: %d %x -> wrong INDEX", classAtom, index, lNewVal));
                 return 0;
   }
+  SetLastError(ERROR_SUCCESS);
+  if(classNameA) {
+        dprintf2(("Win32WndClass::setClassLongA %s: %d %x returned %x", classNameA, index, lNewVal, rc));
+  }
+  else  dprintf2(("Win32WndClass::setClassLongA %d: %d %x returned %x", classAtom, index, lNewVal, rc));
   return(rc);
 }
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 4190)
+++ trunk/src/user32/win32wbase.cpp	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.210 2000-09-04 18:23:56 sandervl Exp $ */
+/* $Id: win32wbase.cpp,v 1.211 2000-09-05 19:20:36 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -666,5 +666,6 @@
   }
 
-  if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
+  //cs is ascii version of create structure. so use SendInternalMessageA
+  if(SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
   {
         RECT tmpRect;
@@ -705,9 +706,11 @@
                 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
             }
-
             if( (getStyle() & WS_CHILD) && !(getExStyle() & WS_EX_NOPARENTNOTIFY) )
             {
                 /* Notify the parent window only */
-                SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());
+                if(getParent() && getParent()->IsWindowDestroyed() == FALSE)
+                {
+                	getParent()->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());
+		}
                 if(!::IsWindow(getWindowHandle()))
                 {
@@ -3013,5 +3016,4 @@
  LONG oldval;
 
-    dprintf2(("SetWindowLong%c %x %d %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
     switch(index) {
         case GWL_EXSTYLE:
@@ -3019,7 +3021,8 @@
            STYLESTRUCT ss;
 
-                if(dwExStyle == value)
-                    return value;
-
+                if(dwExStyle == value) {
+			oldval = value;
+                	break;
+		}
                 ss.styleOld = dwExStyle;
                 ss.styleNew = value;
@@ -3028,5 +3031,6 @@
                 setExStyle(ss.styleNew);
                 SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
-                return ss.styleOld;
+                oldval = ss.styleOld;
+		break;
         }
         case GWL_STYLE:
@@ -3036,7 +3040,8 @@
                 //SvL: TODO: Can you change minimize or maximize status here too?
 
-                if(dwStyle == value)
-                    return value;
-
+                if(dwStyle == value) {
+			oldval = value;
+                	break;
+                }
                 value &= ~(WS_CHILD|WS_VISIBLE);      /* Some bits can't be changed this way (WINE) */
                 ss.styleOld = getStyle();
@@ -3051,5 +3056,6 @@
                 PrintWindowStyle(ss.styleNew, 0);
 #endif
-                return ss.styleOld;
+                oldval = ss.styleOld;
+                break;
         }
         case GWL_WNDPROC:
@@ -3065,23 +3071,24 @@
 	        oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
                 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, type, WIN_PROC_WINDOW);
-                return oldval;
+                break;
         }
         case GWL_HINSTANCE:
                 oldval = hInstance;
                 hInstance = value;
-                return oldval;
+                break;
 
         case GWL_HWNDPARENT:
-                return SetParent((HWND)value);
+                oldval = SetParent((HWND)value);
+                break;
 
         case GWL_ID:
                 oldval = getWindowId();
                 setWindowId(value);
-                return oldval;
+                break;
 
         case GWL_USERDATA:
                 oldval = userData;
                 userData = value;
-                return oldval;
+                break;
 
         default:
@@ -3090,9 +3097,13 @@
                         oldval = userWindowLong[index/4];
                         userWindowLong[index/4] = value;
-                        return oldval;
+	                break;
                 }
+    		dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
                 SetLastError(ERROR_INVALID_PARAMETER);
                 return 0;
     }
+    SetLastError(ERROR_SUCCESS);
+    dprintf2(("SetWindowLong%c %x %d %x returned %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value, oldval));
+    return oldval;
 }
 //******************************************************************************
Index: trunk/src/user32/win32wbase.h
===================================================================
--- trunk/src/user32/win32wbase.h	(revision 4190)
+++ trunk/src/user32/win32wbase.h	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.98 2000-06-07 21:45:52 sandervl Exp $ */
+/* $Id: win32wbase.h,v 1.99 2000-09-05 19:20:37 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -428,10 +428,4 @@
                              RECT *newClientRect );
 
-     LRESULT  SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam)
-     {
-        if(isUnicode)
-                return SendInternalMessageW(msg, wParam, lParam);
-        else    return SendInternalMessageA(msg, wParam, lParam);
-     }
 #else
 friend BOOL  OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs);
Index: trunk/src/user32/winproc.cpp
===================================================================
--- trunk/src/user32/winproc.cpp	(revision 4190)
+++ trunk/src/user32/winproc.cpp	(revision 4194)
@@ -1,3 +1,3 @@
-/* $Id: winproc.cpp,v 1.5 2000-09-04 18:23:58 sandervl Exp $ */
+/* $Id: winproc.cpp,v 1.6 2000-09-05 19:20:38 sandervl Exp $ */
 /*
  * Window procedure callbacks
@@ -302,4 +302,9 @@
     WINDOWPROC *proc = WINPROC_GetPtr( func );
 
+    if(proc) {
+          dprintf2(("CallWindowProcA %x %x %x %x %x -> proc %x, type %d, org func %x", func, hwnd, msg, wParam, lParam, proc, proc->type, WINPROC_THUNKPROC(proc)));
+    }
+    else  dprintf2(("CallWindowProcA %x %x %x %x %x (unknown proc)", func, hwnd, msg, wParam, lParam));
+   
     Win32BaseWindow *window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
@@ -310,9 +315,4 @@
 
     if (!proc) return func(hwnd, msg, wParam, lParam );
-
-#if testing
-    func = WINPROC_GetProc( (HWINDOWPROC)proc, WIN_PROC_32A );
-    return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam );
-#endif
 
     switch(proc->type)
@@ -337,4 +337,9 @@
     WINDOWPROC *proc = WINPROC_GetPtr( func );
 
+    if(proc) {
+          dprintf2(("CallWindowProcW %x %x %x %x %x -> proc %x, type %d, org func %x", func, hwnd, msg, wParam, lParam, proc, proc->type, WINPROC_THUNKPROC(proc)));
+    }
+    else  dprintf2(("CallWindowProcW %x %x %x %x %x (unknown proc)", func, hwnd, msg, wParam, lParam));
+
     Win32BaseWindow *window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
@@ -345,9 +350,4 @@
 
     if (!proc) return func( hwnd, msg, wParam, lParam );
-
-#if testing
-    func = WINPROC_GetProc( (HWINDOWPROC)proc, WIN_PROC_32W );
-    return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam );
-#endif
 
     switch(proc->type)
