Index: trunk/src/user32/new/defwndproc.cpp
===================================================================
--- trunk/src/user32/new/defwndproc.cpp	(revision 391)
+++ trunk/src/user32/new/defwndproc.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: defwndproc.cpp,v 1.3 1999-07-25 09:19:21 sandervl Exp $ */
+/* $Id: defwndproc.cpp,v 1.4 1999-07-25 15:51:55 sandervl Exp $ */
 
 /*
@@ -12,4 +12,5 @@
 #include "user32.h"
 #include "syscolor.h"
+#include "win32wnd.h"
 
 #ifdef DEBUG
@@ -21,81 +22,59 @@
 LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
-#ifdef DEBUG
-////    WriteLog("DEFWNDPROC ");
-////    WriteLog("*DWP*");
-#endif
-    switch(Msg)
-    {
-    case WM_SETREDRAW: //Open32 does not set the visible flag
-        if(wParam)
-                SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
-        else    SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
-
-        return 0; //TODO
-
-    case WM_NCCREATE:
-        return(TRUE);
-
-    case WM_CTLCOLORMSGBOX:
-    case WM_CTLCOLOREDIT:
-    case WM_CTLCOLORLISTBOX:
-    case WM_CTLCOLORBTN:
-    case WM_CTLCOLORDLG:
-    case WM_CTLCOLORSTATIC:
-    case WM_CTLCOLORSCROLLBAR:
-         SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-         SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-         return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY:
-        return 0;
-
-    case WM_MOUSEACTIVATE:
-    {
-        DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
-        DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
-        dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam))));
-        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
-        {
-            LRESULT rc = SendMessageA(GetParent(hwnd), WM_MOUSEACTIVATE, wParam, lParam );
-            if(rc)  return rc;
-        }
-        return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE;
-    }
-    case WM_SETCURSOR:
-    {
-        DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
-        DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
-        dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam))));
-        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
-        {
-            LRESULT rc = SendMessageA(GetParent(hwnd), WM_SETCURSOR, wParam, lParam);
-            if(rc)  return rc;
-        }
-        return 1;
-    }
-    case WM_MOUSEMOVE:
-        return 0;
-
-    case WM_ERASEBKGND:
-    case WM_ICONERASEBKGND:
-        return 0;
-
-    case WM_NCLBUTTONDOWN:
-    case WM_NCLBUTTONUP:
-    case WM_NCLBUTTONDBLCLK:
-    case WM_NCRBUTTONUP:
-    case WM_NCRBUTTONDOWN:
-    case WM_NCRBUTTONDBLCLK:
-    case WM_NCMBUTTONDOWN:
-    case WM_NCMBUTTONUP:
-    case WM_NCMBUTTONDBLCLK:
-        return 0;           //TODO: Send WM_SYSCOMMAND if required
-
-    case WM_NCHITTEST: //TODO:
-        return 0;
-
-    default:
-        return 1;
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("DefWindowProcA, window %x not found", hwnd));
+        return 0;
+    }
+    return window->DefWindowProcA(Msg, wParam, lParam);
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("DefWindowProcW, window %x not found", hwnd));
+        return 0;
+    }
+    return window->DefWindowProcW(Msg, wParam, lParam);
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+#ifdef DEBUG
+////    WriteLog("*DDP*");
+#endif
+    switch(Msg) {
+        case WM_SETREDRAW: //Open32 does not set the visible flag
+                if(wParam)
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
+                else
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
+                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
+        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
+                return(TRUE);
+        case WM_CTLCOLORMSGBOX:
+        case WM_CTLCOLOREDIT:
+        case WM_CTLCOLORLISTBOX:
+        case WM_CTLCOLORBTN:
+        case WM_CTLCOLORDLG:
+        case WM_CTLCOLORSTATIC:
+        case WM_CTLCOLORSCROLLBAR:
+                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+                return GetSysColorBrush(COLOR_BTNFACE);
+
+    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
+        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
+        return 0;
+
+        default:
+                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
     }
 }
@@ -103,70 +82,70 @@
 //NOTE: Unicode msg translation!
 //******************************************************************************
-LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DWPW*");
-#endif
-    switch(Msg) {
-        case WM_SETREDRAW: //Open32 does not set the visible flag
-                if(wParam)
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
-                else
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
-                return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
-        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
-                return(TRUE);
-        case WM_CTLCOLORMSGBOX:
-        case WM_CTLCOLOREDIT:
-        case WM_CTLCOLORLISTBOX:
-        case WM_CTLCOLORBTN:
-        case WM_CTLCOLORDLG:
-        case WM_CTLCOLORSTATIC:
-        case WM_CTLCOLORSCROLLBAR:
-                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-                return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
-        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
-        return 0;
-
-        default:
-                return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
-    }
-}
-//******************************************************************************
-//******************************************************************************
-LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DDP*");
-#endif
-    switch(Msg) {
-        case WM_SETREDRAW: //Open32 does not set the visible flag
-                if(wParam)
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
-                else
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
-                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
-        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
-                return(TRUE);
-        case WM_CTLCOLORMSGBOX:
-        case WM_CTLCOLOREDIT:
-        case WM_CTLCOLORLISTBOX:
-        case WM_CTLCOLORBTN:
-        case WM_CTLCOLORDLG:
-        case WM_CTLCOLORSTATIC:
-        case WM_CTLCOLORSCROLLBAR:
-                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-                return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
-        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
-        return 0;
-
-        default:
-                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
+LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+#ifdef DEBUG
+////    WriteLog("*DDPW*");
+#endif
+    switch(Msg) {
+        case WM_SETREDRAW: //Open32 does not set the visible flag
+                if(wParam)
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
+                else
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
+                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
+        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
+                return(TRUE);
+        case WM_CTLCOLORMSGBOX:
+        case WM_CTLCOLOREDIT:
+        case WM_CTLCOLORLISTBOX:
+        case WM_CTLCOLORBTN:
+        case WM_CTLCOLORDLG:
+        case WM_CTLCOLORSTATIC:
+        case WM_CTLCOLORSCROLLBAR:
+                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+                return GetSysColorBrush(COLOR_BTNFACE);
+
+    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
+        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
+        return 0;
+
+        default:
+                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
+    }
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+#ifdef DEBUG
+////    WriteLog("*DFP*");
+#endif
+    switch(Msg) {
+        case WM_SETREDRAW: //Open32 does not set the visible flag
+                if(wParam)
+                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
+                else
+                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
+                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
+        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
+                return(TRUE);
+        case WM_CTLCOLORMSGBOX:
+        case WM_CTLCOLOREDIT:
+        case WM_CTLCOLORLISTBOX:
+        case WM_CTLCOLORBTN:
+        case WM_CTLCOLORDLG:
+        case WM_CTLCOLORSTATIC:
+        case WM_CTLCOLORSCROLLBAR:
+                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+                return GetSysColorBrush(COLOR_BTNFACE);
+
+    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
+        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
+        return 0;
+
+        default:
+                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
     }
 }
@@ -174,43 +153,8 @@
 //NOTE: Unicode msg translation!
 //******************************************************************************
-LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DDPW*");
-#endif
-    switch(Msg) {
-        case WM_SETREDRAW: //Open32 does not set the visible flag
-                if(wParam)
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
-                else
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
-                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
-        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
-                return(TRUE);
-        case WM_CTLCOLORMSGBOX:
-        case WM_CTLCOLOREDIT:
-        case WM_CTLCOLORLISTBOX:
-        case WM_CTLCOLORBTN:
-        case WM_CTLCOLORDLG:
-        case WM_CTLCOLORSTATIC:
-        case WM_CTLCOLORSCROLLBAR:
-                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-                return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
-        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
-        return 0;
-
-        default:
-                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
-    }
-}
-//******************************************************************************
-//******************************************************************************
-LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DFP*");
+LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+#ifdef DEBUG
+////    WriteLog("*DFPW*");
 #endif
     switch(Msg) {
@@ -243,77 +187,41 @@
 }
 //******************************************************************************
+//******************************************************************************
+LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+#ifdef DEBUG
+////    WriteLog("*DMP*");
+#endif
+    switch(Msg) {
+        case WM_SETREDRAW: //Open32 does not set the visible flag
+                if(wParam)
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
+                else
+                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
+                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
+        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
+                return(TRUE);
+        case WM_CTLCOLORMSGBOX:
+        case WM_CTLCOLOREDIT:
+        case WM_CTLCOLORLISTBOX:
+        case WM_CTLCOLORBTN:
+        case WM_CTLCOLORDLG:
+        case WM_CTLCOLORSTATIC:
+        case WM_CTLCOLORSCROLLBAR:
+                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+                return GetSysColorBrush(COLOR_BTNFACE);
+
+    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
+        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
+        return 0;
+
+        default:
+                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
+    }
+}
+//******************************************************************************
 //NOTE: Unicode msg translation!
 //******************************************************************************
-LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DFPW*");
-#endif
-    switch(Msg) {
-        case WM_SETREDRAW: //Open32 does not set the visible flag
-                if(wParam)
-                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
-                else
-                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
-                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
-        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
-                return(TRUE);
-        case WM_CTLCOLORMSGBOX:
-        case WM_CTLCOLOREDIT:
-        case WM_CTLCOLORLISTBOX:
-        case WM_CTLCOLORBTN:
-        case WM_CTLCOLORDLG:
-        case WM_CTLCOLORSTATIC:
-        case WM_CTLCOLORSCROLLBAR:
-                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-                return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
-        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
-        return 0;
-
-        default:
-                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
-    }
-}
-//******************************************************************************
-//******************************************************************************
-LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-#ifdef DEBUG
-////    WriteLog("*DMP*");
-#endif
-    switch(Msg) {
-        case WM_SETREDRAW: //Open32 does not set the visible flag
-                if(wParam)
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
-                else
-                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
-                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
-        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
-                return(TRUE);
-        case WM_CTLCOLORMSGBOX:
-        case WM_CTLCOLOREDIT:
-        case WM_CTLCOLORLISTBOX:
-        case WM_CTLCOLORBTN:
-        case WM_CTLCOLORDLG:
-        case WM_CTLCOLORSTATIC:
-        case WM_CTLCOLORSCROLLBAR:
-                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-                return GetSysColorBrush(COLOR_BTNFACE);
-
-    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
-        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
-        return 0;
-
-        default:
-                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
-    }
-}
-//******************************************************************************
-//NOTE: Unicode msg translation!
-//******************************************************************************
 LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
Index: trunk/src/user32/new/makefile
===================================================================
--- trunk/src/user32/new/makefile	(revision 391)
+++ trunk/src/user32/new/makefile	(revision 392)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.19 1999-07-24 17:10:25 cbratschi Exp $
+# $Id: makefile,v 1.20 1999-07-25 15:51:55 sandervl Exp $
 
 #
@@ -33,5 +33,5 @@
         oslibutil.obj oslibmsg.obj windlg.obj \
         winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \
-        nativerc.obj oslibres.obj
+        nativerc.obj oslibres.obj winnonclient.obj
 
 
@@ -108,4 +108,6 @@
 oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h
 
+winnonclient.obj: winnonclient.cpp
+
 clean:
         $(RM) *.obj *.lib *.dll *~ *.map *.pch
Index: trunk/src/user32/new/oslibgdi.cpp
===================================================================
--- trunk/src/user32/new/oslibgdi.cpp	(revision 391)
+++ trunk/src/user32/new/oslibgdi.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: oslibgdi.cpp,v 1.6 1999-07-25 08:19:05 sandervl Exp $ */
+/* $Id: oslibgdi.cpp,v 1.7 1999-07-25 15:51:55 sandervl Exp $ */
 /*
  * Window GDI wrapper functions for OS/2
@@ -159,4 +159,7 @@
 HDC OSLibWinGetPS(HWND hwnd)
 {
+  if(hwnd == OSLIB_HWND_DESKTOP)
+	hwnd = HWND_DESKTOP;
+
   return (HDC)WinGetPS(hwnd);
 }
Index: trunk/src/user32/new/pmwindow.cpp
===================================================================
--- trunk/src/user32/new/pmwindow.cpp	(revision 391)
+++ trunk/src/user32/new/pmwindow.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.14 1999-07-25 09:19:21 sandervl Exp $ */
+/* $Id: pmwindow.cpp,v 1.15 1999-07-25 15:51:56 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -473,4 +473,7 @@
             keyflags |= KEY_PREVDOWN;
         }
+        if(fl & KC_DEADKEY) {
+            keyflags |= KEY_DEADKEY;
+        }
         if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
             goto RunDefWndProc;
@@ -499,4 +502,20 @@
     }
 
+    case WM_QUERYWINDOWPARAMS:
+    {
+     PWNDPARAMS wndpars = (PWNDPARAMS)mp1;
+     ULONG textlen;
+     PSZ   wintext;
+
+        if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) {
+            if(wndpars->fsStatus & WPM_CCHTEXT)
+                wndpars->cchText = win32wnd->MsgGetTextLength();
+            if(wndpars->fsStatus & WPM_TEXT)
+                wndpars->pszText = win32wnd->MsgGetText();
+            return (MRESULT)TRUE;
+        }
+        goto RunDefWndProc;
+    }
+
     case WM_PAINT:
         dprintf(("OS2: WM_PAINT %x", hwnd));
@@ -515,5 +534,4 @@
     case WM_SYSVALUECHANGED:
     case WM_CALCVALIDRECTS:
-    case WM_QUERYWINDOWPARAMS:
     case WM_SETSELECTION:
     case WM_PPAINT:
Index: trunk/src/user32/new/user32.cpp
===================================================================
--- trunk/src/user32/new/user32.cpp	(revision 391)
+++ trunk/src/user32/new/user32.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: user32.cpp,v 1.10 1999-07-25 09:19:21 sandervl Exp $ */
+/* $Id: user32.cpp,v 1.11 1999-07-25 15:51:56 sandervl Exp $ */
 
 /*
@@ -258,5 +258,8 @@
 {
 //    ddprintf(("USER32:  CopyRect\n"));
-    if (!lprcDst || !lprcSrc) return FALSE;
+    if (!lprcDst || !lprcSrc) {
+	SetLastError(ERROR_INVALID_PARAMETER);
+	return FALSE;
+    }
 
     memcpy(lprcDst,lprcSrc,sizeof(RECT));
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 391)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.21 1999-07-25 09:19:22 sandervl Exp $ */
+/* $Id: win32wnd.cpp,v 1.22 1999-07-25 15:51:56 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -31,4 +31,5 @@
 #include <oslibres.h>
 #include <winres.h>
+#include "syscolor.h"
 
 #define HAS_DLGFRAME(style,exStyle) \
@@ -60,10 +61,9 @@
 {
   isUnicode        = FALSE;
-
-  windowName       = NULL;
+  fCreated         = FALSE;
+
+  memset(windowNameA, 0, MAX_WINDOW_NAMELENGTH);
+  memset(windowNameW, 0, MAX_WINDOW_NAMELENGTH*sizeof(WCHAR));
   wndNameLength    = 0;
-
-  windowText       = NULL;;
-  wndTextLength    = 0;
 
   userWindowLong   = NULL;;
@@ -115,8 +115,4 @@
   if(Win32Hwnd)
         HMHandleFree(Win32Hwnd & 0xFFFF);
-  if(windowName)
-        free(windowName);
-  if(windowText)
-        free(windowText);
   if(userWindowLong)
         free(userWindowLong);
@@ -248,19 +244,19 @@
   if ((cs->style & WS_CHILD) && cs->hwndParent)
   {
-    SetParent(cs->hwndParent);
+        SetParent(cs->hwndParent);
   }
   else
   {
         if (!cs->hwndParent) {
-                owner = NULL;
+            owner = NULL;
         }
         else
         {
-        owner = GetWindowFromHandle(cs->hwndParent);
-                if(owner == NULL)
-                {
-                        dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
-                        return FALSE;
-                }
+            owner = GetWindowFromHandle(cs->hwndParent);
+            if(owner == NULL)
+            {
+                dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
+                return FALSE;
+            }
         }
   }
@@ -361,4 +357,5 @@
         return FALSE;
   }
+
   if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
         dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
@@ -412,9 +409,14 @@
         if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )
         {
+            if(!(flags & WIN_NEED_SIZE)) {
+                SendMessageA(WM_SIZE, SIZE_RESTORED,
+                                MAKELONG(rectClient.right-rectClient.left,
+                                         rectClient.bottom-rectClient.top));
+                SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
+            }
             SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
                          rectClient.right-rectClient.left,
                          rectClient.bottom-rectClient.top,
                          SWP_NOACTIVATE);
-
             if (cs->style & WS_VISIBLE) ShowWindow( sw );
 
@@ -425,4 +427,5 @@
                 HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
 #endif
+            fCreated = TRUE;
             SetLastError(0);
             return TRUE;
@@ -606,8 +609,8 @@
                                    MinMax.ptMinTrackSize.y );
 
-    if (maxSize) *maxSize = MinMax.ptMaxSize;
-    if (maxPos) *maxPos = MinMax.ptMaxPosition;
-    if (minTrack) *minTrack = MinMax.ptMinTrackSize;
-    if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
+    if (maxSize)    *maxSize  = MinMax.ptMaxSize;
+    if (maxPos)     *maxPos   = MinMax.ptMaxPosition;
+    if (minTrack)   *minTrack = MinMax.ptMinTrackSize;
+    if (maxTrack)   *maxTrack = MinMax.ptMaxTrackSize;
 }
 /***********************************************************************
@@ -619,8 +622,7 @@
  * when calcValidRect is TRUE.
  */
-LONG Win32Window::SendNCCalcSize(BOOL calcValidRect,
-                            RECT *newWindowRect, RECT *oldWindowRect,
-                            RECT *oldClientRect, WINDOWPOS *winpos,
-                            RECT *newClientRect )
+LONG Win32Window::SendNCCalcSize(BOOL calcValidRect, RECT *newWindowRect, RECT *oldWindowRect,
+                                 RECT *oldClientRect, WINDOWPOS *winpos,
+                                 RECT *newClientRect )
 {
    NCCALCSIZE_PARAMS params;
@@ -632,7 +634,7 @@
    {
         winposCopy = *winpos;
-    params.rgrc[1] = *oldWindowRect;
-    params.rgrc[2] = *oldClientRect;
-    params.lppos = &winposCopy;
+        params.rgrc[1] = *oldWindowRect;
+        params.rgrc[2] = *oldClientRect;
+        params.lppos = &winposCopy;
    }
    result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
@@ -723,4 +725,8 @@
  WORD fwSizeType = 0;
 
+    if(fCreated == FALSE) {//Solitaire crashes if it receives a WM_SIZE during CreateWindowEx (normal or our fault?)
+        return 1;
+    }
+
     if(fMinimize) {
             fwSizeType = SIZE_MINIMIZED;
@@ -747,5 +753,5 @@
 }
 //******************************************************************************
-//TODO: virtual key translation & extended keyboard bit
+//TODO: virtual key & (possibly) scancode translation, extended keyboard bit & Unicode
 //******************************************************************************
 ULONG Win32Window::MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags)
@@ -761,6 +767,12 @@
     if(keyflags & KEY_UP)
         lParam |= (1<<31);
-    dprintf(("WM_CHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
-    return SendInternalMessageA(WM_CHAR, cmd, lParam);
+    if(keyflags & KEY_DEADKEY) {
+        dprintf(("WM_DEADCHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
+        return SendInternalMessageA(WM_DEADCHAR, cmd, lParam);
+    }
+    else {
+        dprintf(("WM_CHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
+        return SendInternalMessageA(WM_CHAR, cmd, lParam);
+    }
 }
 //******************************************************************************
@@ -832,18 +844,18 @@
 ULONG Win32Window::MsgMouseMove(ULONG keystate, ULONG x, ULONG y)
 {
-ULONG winstate = 0;
-
-  if(keystate & WMMOVE_LBUTTON)
-    winstate |= MK_LBUTTON;
-  if(keystate & WMMOVE_RBUTTON)
-    winstate |= MK_RBUTTON;
-  if(keystate & WMMOVE_MBUTTON)
-    winstate |= MK_MBUTTON;
-  if(keystate & WMMOVE_SHIFT)
-    winstate |= MK_SHIFT;
-  if(keystate & WMMOVE_CTRL)
-    winstate |= MK_CONTROL;
-
-   return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y));
+ ULONG winstate = 0;
+
+    if(keystate & WMMOVE_LBUTTON)
+        winstate |= MK_LBUTTON;
+    if(keystate & WMMOVE_RBUTTON)
+        winstate |= MK_RBUTTON;
+    if(keystate & WMMOVE_MBUTTON)
+        winstate |= MK_MBUTTON;
+    if(keystate & WMMOVE_SHIFT)
+        winstate |= MK_SHIFT;
+    if(keystate & WMMOVE_CTRL)
+        winstate |= MK_CONTROL;
+
+    return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y));
 }
 //******************************************************************************
@@ -851,5 +863,5 @@
 ULONG Win32Window::MsgPaint(ULONG tmp1, ULONG tmp2)
 {
-  return SendInternalMessageA(WM_PAINT, 0, 0);
+    return SendInternalMessageA(WM_PAINT, 0, 0);
 }
 //******************************************************************************
@@ -866,8 +878,137 @@
 ULONG Win32Window::MsgSetText(LPSTR lpsz, LONG cch)
 {
-  if(isUnicode) {
-        return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
-  }
-  else  return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
+    if(isUnicode) {
+            return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
+    }
+    else    return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
+}
+//******************************************************************************
+//TODO: in- or excluding terminating 0?
+//******************************************************************************
+ULONG Win32Window::MsgGetTextLength()
+{
+    return SendInternalMessageA(WM_GETTEXTLENGTH, 0, 0);
+}
+//******************************************************************************
+//******************************************************************************
+char *Win32Window::MsgGetText()
+{
+    if(isUnicode) {
+        SendInternalMessageW(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameW);
+    }
+    else {
+        SendInternalMessageA(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameA);
+    }
+    return windowNameA;
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT Win32Window::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+    switch(Msg)
+    {
+    case WM_GETTEXTLENGTH:
+        return wndNameLength;
+
+    case WM_GETTEXT:   //TODO: SS_ICON controls
+        strncpy((LPSTR)lParam, windowNameA, wParam);
+        return min(wndNameLength, wParam);
+
+    case WM_SETTEXT:
+        return 0;
+
+    case WM_SETREDRAW:
+        if(wParam)
+                SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) | WS_VISIBLE);
+        else    SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) & ~WS_VISIBLE);
+
+        return 0; //TODO
+
+    case WM_NCCREATE:
+        return(TRUE);
+
+    case WM_CTLCOLORMSGBOX:
+    case WM_CTLCOLOREDIT:
+    case WM_CTLCOLORLISTBOX:
+    case WM_CTLCOLORBTN:
+    case WM_CTLCOLORDLG:
+    case WM_CTLCOLORSTATIC:
+    case WM_CTLCOLORSCROLLBAR:
+         SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+         SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+         return GetSysColorBrush(COLOR_BTNFACE);
+
+    case WM_PARENTNOTIFY:
+        return 0;
+
+    case WM_MOUSEACTIVATE:
+    {
+        DWORD dwStyle = GetWindowLongA(GWL_STYLE);
+        DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
+        dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
+        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
+        {
+            if(getParent()) {
+                LRESULT rc = getParent()->SendMessageA(WM_MOUSEACTIVATE, wParam, lParam );
+                if(rc)  return rc;
+            }
+        }
+        return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE;
+    }
+    case WM_SETCURSOR:
+    {
+        DWORD dwStyle = GetWindowLongA(GWL_STYLE);
+        DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
+        dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
+        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
+        {
+            if(getParent()) {
+                LRESULT rc = getParent()->SendMessageA(WM_SETCURSOR, wParam, lParam);
+                if(rc)  return rc;
+            }
+        }
+        return 1;
+    }
+    case WM_MOUSEMOVE:
+        return 0;
+
+    case WM_ERASEBKGND:
+    case WM_ICONERASEBKGND:
+        return 0;
+
+    case WM_NCLBUTTONDOWN:
+    case WM_NCLBUTTONUP:
+    case WM_NCLBUTTONDBLCLK:
+    case WM_NCRBUTTONUP:
+    case WM_NCRBUTTONDOWN:
+    case WM_NCRBUTTONDBLCLK:
+    case WM_NCMBUTTONDOWN:
+    case WM_NCMBUTTONUP:
+    case WM_NCMBUTTONDBLCLK:
+        return 0;           //TODO: Send WM_SYSCOMMAND if required
+
+    case WM_NCHITTEST: //TODO:
+        return 0;
+
+    default:
+        return 1;
+    }
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT Win32Window::DefWindowProcW(UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+    switch(Msg)
+    {
+    case WM_GETTEXTLENGTH:
+        return wndNameLength;
+
+    case WM_GETTEXT:   //TODO: SS_ICON controls
+        lstrcpynW((LPWSTR)lParam, windowNameW, wParam);
+        return min(wndNameLength, wParam);
+
+    default:
+        return DefWindowProcA(Msg, wParam, lParam);
+    }
 }
 //******************************************************************************
@@ -897,4 +1038,7 @@
                 return(0);
         }
+        case WM_SETTEXT: //TODO: Nothing happens if passed to DefWindowProc
+                return win32wndproc(getWindowHandle(), WM_SETTEXT, wParam, lParam);
+
         case WM_LBUTTONDOWN:
         case WM_MBUTTONDOWN:
@@ -937,4 +1081,7 @@
                 return(1);
         }
+        case WM_SETTEXT: //TODO: Nothing happens if passed to DefWindowProc
+                return win32wndproc(getWindowHandle(), WM_SETTEXT, wParam, lParam);
+
         case WM_LBUTTONDOWN:
         case WM_MBUTTONDOWN:
@@ -1100,7 +1247,8 @@
  Win32Resource *winres = (Win32Resource *)hMenu;
 
+    dprintf(("SetMenu %x", hMenu));
     if(HIWORD(winres) == 0) {
         dprintf(("Win32Window:: Win32Resource *winres == 0"));
-    SetLastError(ERROR_INVALID_PARAMETER);
+        SetLastError(ERROR_INVALID_PARAMETER);
         return FALSE;
     }
Index: trunk/src/user32/new/win32wnd.h
===================================================================
--- trunk/src/user32/new/win32wnd.h	(revision 391)
+++ trunk/src/user32/new/win32wnd.h	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.h,v 1.18 1999-07-25 09:19:22 sandervl Exp $ */
+/* $Id: win32wnd.h,v 1.19 1999-07-25 15:51:56 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -43,4 +43,6 @@
 #define WM_WIN32_POSTMESSAGEA	0x4000
 #define WM_WIN32_POSTMESSAGEW	0x4001
+
+#define MAX_WINDOW_NAMELENGTH	256
 
 class Win32Window : private GenericObject, private ChildWindow
@@ -73,4 +75,6 @@
 	 ULONG  MsgEraseBackGround(ULONG hps);
 	 ULONG  MsgSetText(LPSTR lpsz, LONG cch);
+	 ULONG  MsgGetTextLength();
+	 char  *MsgGetText();
 
 virtual	 LONG   SetWindowLongA(int index, ULONG value);
@@ -134,6 +138,6 @@
        BOOL     PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
        BOOL     PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
-       LRESULT  DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-       LRESULT  DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+       LRESULT  DefWindowProcA(UINT msg, WPARAM wParam, LPARAM lParam);
+       LRESULT  DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
 
          void   NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
@@ -192,4 +196,5 @@
 
 	BOOL    isIcon;
+	BOOL    fCreated;
 
    Win32Window *owner;			
@@ -199,10 +204,8 @@
  Win32Resource *iconResource;
 
-	char   *windowName;
+	char    windowNameA[MAX_WINDOW_NAMELENGTH];
+	WCHAR   windowNameW[MAX_WINDOW_NAMELENGTH];
 	ULONG   wndNameLength;
 
-	char   *windowText;
-	ULONG   wndTextLength;
-	
 	ULONG  *userWindowLong;
 	ULONG	nrUserWindowLong;
@@ -277,4 +280,5 @@
 #define KEY_PREVDOWN		2
 #define KEY_UP			4
+#define KEY_DEADKEY		8
 
 #endif //__cplusplus
Index: trunk/src/user32/new/window.cpp
===================================================================
--- trunk/src/user32/new/window.cpp	(revision 391)
+++ trunk/src/user32/new/window.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: window.cpp,v 1.10 1999-07-25 09:19:22 sandervl Exp $ */
+/* $Id: window.cpp,v 1.11 1999-07-25 15:51:57 sandervl Exp $ */
 /*
  * Win32 window apis for OS/2
@@ -647,167 +647,4 @@
 #endif
     return O32_FindWindow(arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
-{
-    dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
-    return OSLibWinFlashWindow(Win32Window::Win32ToOS2Handle(hwnd), fFlash);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API MoveWindow(HWND arg1, int arg2, int arg3, int arg4, int arg5, BOOL arg6)
-{
- BOOL rc;
-
-    rc = O32_MoveWindow(arg1, arg2, arg3, arg4, arg5, arg6);
-    dprintf(("USER32:  MoveWindow %X to (%d,%d) size (%d,%d), repaint = %d returned %d\n", arg1, arg2, arg3, arg4, arg5, arg6, rc));
-    return(rc);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API AdjustWindowRect( PRECT arg1, DWORD arg2, BOOL  arg3)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  AdjustWindowRect\n");
-#endif
-    return O32_AdjustWindowRect(arg1, arg2, arg3);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API AdjustWindowRectEx( PRECT arg1, DWORD arg2, BOOL arg3, DWORD  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  AdjustWindowRectEx\n");
-#endif
-    return O32_AdjustWindowRectEx(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API ClientToScreen( HWND arg1, PPOINT  arg2)
-{
-#ifdef DEBUG
-////    WriteLog("USER32:  ClientToScreen\n");
-#endif
-    return O32_ClientToScreen(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-HDWP WIN32API BeginDeferWindowPos( int arg1)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  BeginDeferWindowPos\n");
-#endif
-    return O32_BeginDeferWindowPos(arg1);
-}
-//******************************************************************************
-//******************************************************************************
-HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND  arg3, int arg4, int arg5, int arg6, int arg7, UINT  arg8)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  DeferWindowPos\n");
-#endif
-    return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-}
-//******************************************************************************
-//******************************************************************************
-HWND WIN32API ChildWindowFromPoint( HWND arg1, POINT  arg2)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ChildWindowFromPoint\n");
-#endif
-    return O32_ChildWindowFromPoint(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-HWND WIN32API ChildWindowFromPointEx(HWND arg1, POINT arg2, UINT uFlags)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ChildWindowFromPointEx, not completely supported!\n");
-#endif
-    return O32_ChildWindowFromPoint(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API CloseWindow(HWND hwnd)
-{
-   Win32Window *window;
-
-    window = Win32Window::GetWindowFromHandle(hwnd);
-    if(!window) {
-        dprintf(("CloseWindow, window %x not found", hwnd));
-        return 0;
-    }
-    dprintf(("CloseWindow %x\n", hwnd));
-    return window->CloseWindow();
-}
-//******************************************************************************
-//******************************************************************************
-HWND WIN32API WindowFromDC(HDC hdc)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  WindowFromDC\n");
-#endif
-    return O32_WindowFromDC(hdc);
-}
-//******************************************************************************
-//TODO: Does this return handles of hidden or disabled windows?
-//******************************************************************************
-HWND WIN32API WindowFromPoint( POINT point)
-{
- HWND hwnd;
-
-    dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
-    hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
-    if(hwnd) {
-        return Win32Window::OS2ToWin32Handle(hwnd);
-    }
-    return 0;
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API IsWindowUnicode(HWND hwnd)
-{
-   Win32Window *window;
-
-    window = Win32Window::GetWindowFromHandle(hwnd);
-    if(!window) {
-        dprintf(("IsWindowUnicode, window %x not found", hwnd));
-        return 0;
-    }
-    return window->IsUnicode();
-}
-/*****************************************************************************
- * Name      : WORD WIN32API CascadeWindows
- * Purpose   : The CascadeWindows function cascades the specified windows or
- *             the child windows of the specified parent window.
- * Parameters: HWND hwndParent         handle of parent window
- *             UINT wHow               types of windows not to arrange
- *             CONST RECT * lpRect     rectangle to arrange windows in
- *             UINT cKids              number of windows to arrange
- *             const HWND FAR * lpKids array of window handles
- * Variables :
- * Result    : If the function succeeds, the return value is the number of windows arranged.
- *             If the function fails, the return value is zero.
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
- *****************************************************************************/
-
-WORD WIN32API CascadeWindows(HWND       hwndParent,
-                             UINT       wHow,
-                             CONST LPRECT lpRect,
-                             UINT       cKids,
-                             const HWND *lpKids)
-{
-  dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
-         hwndParent,
-         wHow,
-         lpRect,
-         cKids,
-         lpKids));
-
-  return (0);
 }
 /*****************************************************************************
@@ -845,4 +682,140 @@
   return (NULL);
 }
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
+{
+    dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
+    return OSLibWinFlashWindow(Win32Window::Win32ToOS2Handle(hwnd), fFlash);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API MoveWindow(HWND arg1, int arg2, int arg3, int arg4, int arg5, BOOL arg6)
+{
+ BOOL rc;
+
+    rc = O32_MoveWindow(arg1, arg2, arg3, arg4, arg5, arg6);
+    dprintf(("USER32:  MoveWindow %X to (%d,%d) size (%d,%d), repaint = %d returned %d\n", arg1, arg2, arg3, arg4, arg5, arg6, rc));
+    return(rc);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API ClientToScreen( HWND arg1, PPOINT  arg2)
+{
+#ifdef DEBUG
+////    WriteLog("USER32:  ClientToScreen\n");
+#endif
+    return O32_ClientToScreen(arg1, arg2);
+}
+//******************************************************************************
+//******************************************************************************
+HDWP WIN32API BeginDeferWindowPos( int arg1)
+{
+#ifdef DEBUG
+    WriteLog("USER32:  BeginDeferWindowPos\n");
+#endif
+    return O32_BeginDeferWindowPos(arg1);
+}
+//******************************************************************************
+//******************************************************************************
+HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND  arg3, int arg4, int arg5, int arg6, int arg7, UINT  arg8)
+{
+#ifdef DEBUG
+    WriteLog("USER32:  DeferWindowPos\n");
+#endif
+    return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+}
+//******************************************************************************
+//******************************************************************************
+HWND WIN32API ChildWindowFromPoint( HWND arg1, POINT  arg2)
+{
+#ifdef DEBUG
+    WriteLog("USER32:  ChildWindowFromPoint\n");
+#endif
+    return O32_ChildWindowFromPoint(arg1, arg2);
+}
+//******************************************************************************
+//******************************************************************************
+HWND WIN32API ChildWindowFromPointEx(HWND arg1, POINT arg2, UINT uFlags)
+{
+#ifdef DEBUG
+    WriteLog("USER32:  ChildWindowFromPointEx, not completely supported!\n");
+#endif
+    return O32_ChildWindowFromPoint(arg1, arg2);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API CloseWindow(HWND hwnd)
+{
+   Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("CloseWindow, window %x not found", hwnd));
+        return 0;
+    }
+    dprintf(("CloseWindow %x\n", hwnd));
+    return window->CloseWindow();
+}
+//******************************************************************************
+//TODO: Does this return handles of hidden or disabled windows?
+//******************************************************************************
+HWND WIN32API WindowFromPoint( POINT point)
+{
+ HWND hwnd;
+
+    dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
+    hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
+    if(hwnd) {
+        return Win32Window::OS2ToWin32Handle(hwnd);
+    }
+    return 0;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsWindowUnicode(HWND hwnd)
+{
+   Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+        dprintf(("IsWindowUnicode, window %x not found", hwnd));
+        return 0;
+    }
+    return window->IsUnicode();
+}
+/*****************************************************************************
+ * Name      : WORD WIN32API CascadeWindows
+ * Purpose   : The CascadeWindows function cascades the specified windows or
+ *             the child windows of the specified parent window.
+ * Parameters: HWND hwndParent         handle of parent window
+ *             UINT wHow               types of windows not to arrange
+ *             CONST RECT * lpRect     rectangle to arrange windows in
+ *             UINT cKids              number of windows to arrange
+ *             const HWND FAR * lpKids array of window handles
+ * Variables :
+ * Result    : If the function succeeds, the return value is the number of windows arranged.
+ *             If the function fails, the return value is zero.
+ * Remark    :
+ * Status    : UNTESTED STUB
+ *
+ * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
+ *****************************************************************************/
+
+WORD WIN32API CascadeWindows(HWND       hwndParent,
+                             UINT       wHow,
+                             CONST LPRECT lpRect,
+                             UINT       cKids,
+                             const HWND *lpKids)
+{
+  dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
+         hwndParent,
+         wHow,
+         lpRect,
+         cKids,
+         lpKids));
+
+  return (0);
+}
 /*****************************************************************************
  * Name      : BOOL WIN32API SwitchToThisWindow
Index: trunk/src/user32/new/wingdi.cpp
===================================================================
--- trunk/src/user32/new/wingdi.cpp	(revision 391)
+++ trunk/src/user32/new/wingdi.cpp	(revision 392)
@@ -1,3 +1,3 @@
-/* $Id: wingdi.cpp,v 1.7 1999-07-25 09:19:22 sandervl Exp $ */
+/* $Id: wingdi.cpp,v 1.8 1999-07-25 15:51:57 sandervl Exp $ */
 /*
  * Win32 Window graphics apis for OS/2
@@ -65,6 +65,13 @@
    window = Win32Window::GetWindowFromHandle(hwnd);
    if(!window) {
-    dprintf(("GetDC, window %x not found", hwnd));
-    return 0;
+    	dprintf(("GetDC, window %x not found", hwnd));
+#ifdef OPEN32_GDI
+	dprintf(("GetDC %x", hwnd));
+    	return O32_GetDC(0);
+#else
+	//desktop window?
+	dprintf(("GetDC %x", hwnd));
+	return OSLibWinGetPS(OSLIB_HWND_DESKTOP);
+#endif
    }
    dprintf(("GetDC %x", hwnd));
@@ -89,4 +96,5 @@
 int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
 {
+    dprintf(("ReleaseDC %x %x", hwnd, hdc));
 #ifdef OPEN32_GDI
     return O32_ReleaseDC(hwnd,hdc);
@@ -115,2 +123,13 @@
 //******************************************************************************
 //******************************************************************************
+HWND WIN32API WindowFromDC(HDC hdc)
+{
+    dprintf(("USER32:  WindowFromDC\n"));
+#ifdef OPEN32_GDI
+    return O32_WindowFromDC(hdc);
+#else
+    ?????
+#endif
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/new/winnonclient.cpp
===================================================================
--- trunk/src/user32/new/winnonclient.cpp	(revision 392)
+++ trunk/src/user32/new/winnonclient.cpp	(revision 392)
@@ -0,0 +1,190 @@
+/* $Id: winnonclient.cpp,v 1.1 1999-07-25 15:51:57 sandervl Exp $ */
+/*
+ * Win32 menu API functions for OS/2
+ *
+ * Copyright 1998 Sander van Leeuwen (Port from Wine)
+ *
+ * Parts ported from Wine: (window\nonclient.c)
+ * Copyright 1994 Alexandre Julliard
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#include <os2win.h>
+
+  /* Some useful macros */
+#define HAS_DLGFRAME(style,exStyle) \
+    (((exStyle) & WS_EX_DLGMODALFRAME) || \
+     (((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
+
+#define HAS_THICKFRAME(style) \
+    (((style) & WS_THICKFRAME) && \
+     !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
+
+#define HAS_FIXEDFRAME(style,exStyle) \
+   (((((exStyle) & WS_EX_DLGMODALFRAME) || \
+      ((style) & WS_DLGFRAME)) && ((style) & WS_BORDER)) && \
+     !((style) & WS_THICKFRAME))
+
+/* win31 style (simple border) in win95 look */
+#define HAS_CLASSICBORDER(style,exStyle) \
+    (!((exStyle) & WS_EX_STATICEDGE) && !((exStyle) & WS_EX_CLIENTEDGE) && \
+    !((style) & WS_THICKFRAME) && !((style) & WS_DLGFRAME) && \
+    ((style) & WS_BORDER))
+
+#define HAS_SIZEFRAME(style) \
+    (((style) & WS_THICKFRAME) && \
+     !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
+
+#define HAS_MENU(w)  (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0))
+
+#define ON_LEFT_BORDER(hit) \
+ (((hit) == HTLEFT) || ((hit) == HTTOPLEFT) || ((hit) == HTBOTTOMLEFT))
+#define ON_RIGHT_BORDER(hit) \
+ (((hit) == HTRIGHT) || ((hit) == HTTOPRIGHT) || ((hit) == HTBOTTOMRIGHT))
+#define ON_TOP_BORDER(hit) \
+ (((hit) == HTTOP) || ((hit) == HTTOPLEFT) || ((hit) == HTTOPRIGHT))
+#define ON_BOTTOM_BORDER(hit) \
+ (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
+
+/******************************************************************************
+ * NC_AdjustRectOuter95
+ *
+ * Computes the size of the "outside" parts of the window based on the
+ * parameters of the client area.
+ *
+ + PARAMS
+ *     LPRECT16  rect
+ *     DWORD  style
+ *     BOOL32  menu
+ *     DWORD  exStyle
+ *
+ * NOTES
+ *     "Outer" parts of a window means the whole window frame, caption and
+ *     menu bar. It does not include "inner" parts of the frame like client
+ *     edge, static edge or scroll bars.
+ *
+ * Revision history
+ *     05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
+ *        Original (NC_AdjustRect95) cut & paste from NC_AdjustRect
+ *
+ *     20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de)
+ *        Split NC_AdjustRect95 into NC_AdjustRectOuter95 and
+ *        NC_AdjustRectInner95 and added handling of Win95 styles.
+ *
+ *****************************************************************************/
+
+static void
+NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle)
+{
+    if(style & WS_ICONIC) return;
+
+    /* Decide if the window will be managed (see CreateWindowEx) */
+#if 0
+    if (!(Options.managed && !(style & WS_CHILD) &&
+          ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
+           (exStyle & WS_EX_DLGMODALFRAME))))
+#else
+    if (!(style & WS_CHILD) &&
+          ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
+           (exStyle & WS_EX_DLGMODALFRAME)))
+#endif
+    {
+        if (HAS_FIXEDFRAME( style, exStyle ))
+            InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) );
+        else
+        {
+            if (HAS_SIZEFRAME(style))
+                InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
+#if 0
+            if (style & WS_BORDER)
+                InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
+#endif
+        }
+
+        if ((style & WS_CAPTION) == WS_CAPTION)
+        {
+	    if (exStyle & WS_EX_TOOLWINDOW)
+		rect->top -= GetSystemMetrics(SM_CYSMCAPTION);
+	    else
+		rect->top -= GetSystemMetrics(SM_CYCAPTION);
+        }
+    }
+
+    if (menu)
+	rect->top -= GetSystemMetrics(SM_CYMENU);
+}
+
+
+/******************************************************************************
+ * NC_AdjustRectInner95
+ *
+ * Computes the size of the "inside" part of the window based on the
+ * parameters of the client area.
+ *
+ + PARAMS
+ *     LPRECT16 rect
+ *     DWORD    style
+ *     DWORD    exStyle
+ *
+ * NOTES
+ *     "Inner" part of a window means the window frame inside of the flat
+ *     window frame. It includes the client edge, the static edge and the
+ *     scroll bars.
+ *
+ * Revision history
+ *     05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
+ *        Original (NC_AdjustRect95) cut & paste from NC_AdjustRect
+ *
+ *     20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de)
+ *        Split NC_AdjustRect95 into NC_AdjustRectOuter95 and
+ *        NC_AdjustRectInner95 and added handling of Win95 styles.
+ *
+ *****************************************************************************/
+
+static void
+NC_AdjustRectInner95 (LPRECT rect, DWORD style, DWORD exStyle)
+{
+    if(style & WS_ICONIC) return;
+
+    if (exStyle & WS_EX_CLIENTEDGE)
+	InflateRect (rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
+
+    if (exStyle & WS_EX_STATICEDGE)
+	InflateRect (rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
+
+    if (HAS_CLASSICBORDER(style, exStyle))
+        InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER ));
+
+    if (style & WS_VSCROLL) rect->right  += GetSystemMetrics(SM_CXVSCROLL);
+    if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL);
+}
+
+/***********************************************************************
+ *           AdjustWindowRectEx    (USER.454)
+ */
+BOOL WIN32API AdjustWindowRectEx(LPRECT rect, DWORD style,
+                                 BOOL menu, DWORD exStyle )
+{
+      /* Correct the window style */
+    if (!(style & (WS_POPUP | WS_CHILD)))  /* Overlapped window */
+	style |= WS_CAPTION;
+    style &= (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME | WS_CHILD);
+    exStyle &= (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE |
+		WS_EX_STATICEDGE | WS_EX_TOOLWINDOW);
+    if (exStyle & WS_EX_DLGMODALFRAME) style &= ~WS_THICKFRAME;
+
+    NC_AdjustRectOuter95( rect, style, menu, exStyle );
+    NC_AdjustRectInner95( rect, style, exStyle );
+
+    return TRUE;
+}
+
+/***********************************************************************
+ *           AdjustWindowRect    (USER32.2)
+ */
+BOOL WIN32API AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu )
+{
+    return AdjustWindowRectEx( rect, style, menu, 0 );
+}
