Index: trunk/src/user32/new/makefile
===================================================================
--- trunk/src/user32/new/makefile	(revision 320)
+++ trunk/src/user32/new/makefile	(revision 321)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.6 1999-07-17 09:17:57 sandervl Exp $
+# $Id: makefile,v 1.7 1999-07-17 11:52:22 sandervl Exp $
 
 #
@@ -29,5 +29,5 @@
         msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \
         windowword.obj gen_object.obj oslibwin.obj win32wndchild.obj \
-        controls.obj button.obj oslibutil.obj
+        controls.obj button.obj oslibutil.obj oslibmsg.obj
 
 
@@ -84,5 +84,7 @@
 gen_object.obj: gen_object.cpp gen_object.h
 oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h
-oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h
+oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
+oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
+
 
 clean:
Index: trunk/src/user32/new/oslibmsg.cpp
===================================================================
--- trunk/src/user32/new/oslibmsg.cpp	(revision 321)
+++ trunk/src/user32/new/oslibmsg.cpp	(revision 321)
@@ -0,0 +1,43 @@
+/* $Id: oslibmsg.cpp,v 1.1 1999-07-17 11:52:22 sandervl Exp $ */
+/*
+ * Window message translation functions for OS/2
+ *
+ *
+ * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ * TODO: Simply copy for now. Probably need to make a real translation
+ *
+ */
+#define  INCL_WIN
+#define  INCL_PM
+#include <os2.h>
+#include <os2wrap.h>
+#include <string.h>
+#include <misc.h>
+#include "oslibmsg.h"
+
+//******************************************************************************
+//******************************************************************************
+void WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode)
+{
+  memcpy(os2Msg, winMsg, sizeof(MSG));
+  os2Msg->reserved = 0;
+}
+//******************************************************************************
+//******************************************************************************
+void OS2ToWinMsgTranslate(QMSG *os2Msg, MSG *winMsg, BOOL isUnicode)
+{
+  memcpy(winMsg, os2Msg, sizeof(MSG));
+}
+//******************************************************************************
+//TODO!!!
+//******************************************************************************
+ULONG TranslateWinMsg(ULONG msg)
+{
+  return 0;
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/new/oslibmsg.h
===================================================================
--- trunk/src/user32/new/oslibmsg.h	(revision 321)
+++ trunk/src/user32/new/oslibmsg.h	(revision 321)
@@ -0,0 +1,19 @@
+/* $Id: oslibmsg.h,v 1.1 1999-07-17 11:52:22 sandervl Exp $ */
+/*
+ * Window message translation functions for OS/2
+ *
+ *
+ * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#ifndef __OSLIBMSG_H__
+#define __OSLIBMSG_H__
+
+ULONG TranslateWinMsg(ULONG msg);
+void  OS2ToWinMsgTranslate(QMSG *os2Msg, MSG *winMsg, BOOL isUnicode);
+void  WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode);
+
+#endif //__OSLIBMSG_H__
Index: trunk/src/user32/new/oslibwin.cpp
===================================================================
--- trunk/src/user32/new/oslibwin.cpp	(revision 320)
+++ trunk/src/user32/new/oslibwin.cpp	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
+/* $Id: oslibwin.cpp,v 1.6 1999-07-17 11:52:22 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -14,8 +14,12 @@
 #include <os2.h>
 #include <os2wrap.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include <misc.h>
 #include <oslibwin.h>
 #include "oslibstyle.h"
 #include "oslibutil.h"
+#include "oslibmsg.h"
 #include "pmwindow.h"
 
@@ -141,7 +145,7 @@
 //******************************************************************************
 //******************************************************************************
-HWND OSLibWinQueryTopMostChildWindow(HWND hwndParent)
-{
-  return WinQueryWindow(hwndParent, QW_TOP);
+HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode)
+{
+  return WinQueryWindow(hwnd, lCode);
 }
 //******************************************************************************
@@ -189,2 +193,64 @@
 //******************************************************************************
 //******************************************************************************
+BOOL OSLibWinSetActiveWindow(HWND hwnd)
+{
+  return WinSetActiveWindow(HWND_DESKTOP, hwnd);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinSetFocus(HWND hwnd)
+{
+  return WinSetFocus(HWND_DESKTOP, hwnd);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable)
+{
+  return WinEnableWindow(hwnd, fEnable);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinIsWindowEnabled(HWND hwnd)
+{
+  return WinIsWindowEnabled(hwnd);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinIsWindowVisible(HWND hwnd)
+{
+  return WinIsWindowVisible(hwnd);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinQueryActiveWindow()
+{
+  return WinQueryActiveWindow(HWND_DESKTOP);
+}
+//******************************************************************************
+//******************************************************************************
+void OSLibWinPostQuitMessage(ULONG nExitCode)
+{
+  WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0);
+}
+//******************************************************************************
+//******************************************************************************
+LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)
+{
+ QMSG qmsg;
+
+  WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
+  return (LONG)WinDispatchMsg(GetThreadHAB(), &qmsg);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode)
+{
+ QMSG qmsg;
+ BOOL rc;
+
+  rc = WinGetMsg(GetThreadHAB(), &qmsg, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);
+  OS2ToWinMsgTranslate(&qmsg, pMsg, isUnicode);
+  return rc;
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/new/oslibwin.h
===================================================================
--- trunk/src/user32/new/oslibwin.h	(revision 320)
+++ trunk/src/user32/new/oslibwin.h	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.h,v 1.4 1999-07-17 09:17:58 sandervl Exp $ */
+/* $Id: oslibwin.h,v 1.5 1999-07-17 11:52:22 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -32,6 +32,4 @@
 HWND  OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);
 
-HWND  OSLibWinQueryTopMostChildWindow(HWND hwndParent);
-
 
 #define SWPOS_SIZE                   0x0001
@@ -52,4 +50,7 @@
 #define SWPOS_NOAUTOCLOSE            0x8000    /* Valid in PROGDETAILS struct only */
 
+#define HWNDOS_TOP                      (HWND)3
+#define HWNDOS_BOTTOM                   (HWND)4
+
 BOOL  OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl);
 BOOL  OSLibWinShowWindow(HWND hwnd, ULONG fl);
@@ -58,4 +59,28 @@
 BOOL  OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer!
 BOOL  OSLibWinIsIconic(HWND hwnd);
+BOOL  OSLibWinSetActiveWindow(HWND hwnd);
+BOOL  OSLibWinSetFocus(HWND hwnd);
+BOOL  OSLibWinEnableWindow(HWND hwnd, BOOL fEnable);
+BOOL  OSLibWinIsWindowEnabled(HWND hwnd);
+BOOL  OSLibWinIsWindowVisible(HWND hwnd);
+BOOL  OSLibWinQueryActiveWindow();
+
+#define QWOS_NEXT         0
+#define QWOS_PREV         1
+#define QWOS_TOP          2
+#define QWOS_BOTTOM       3
+#define QWOS_OWNER        4
+#define QWOS_PARENT       5
+#define QWOS_NEXTTOP      6
+#define QWOS_PREVTOP      7
+#define QWOS_FRAMEOWNER   8
+
+HWND  OSLibWinQueryWindow(HWND hwnd, ULONG lCode);
+
+
+void  OSLibWinPostQuitMessage(ULONG nExitCode);
+LONG  OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE);
+
+BOOL  OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE);
 
 #endif //__OSLIBWIN_H__
Index: trunk/src/user32/new/user32.cpp
===================================================================
--- trunk/src/user32/new/user32.cpp	(revision 320)
+++ trunk/src/user32/new/user32.cpp	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: user32.cpp,v 1.2 1999-07-16 17:50:10 cbratschi Exp $ */
+/* $Id: user32.cpp,v 1.3 1999-07-17 11:52:22 sandervl Exp $ */
 
 /*
@@ -263,9 +263,4 @@
 //******************************************************************************
 //******************************************************************************
-BOOL WIN32API GetMessageA( LPMSG arg1, HWND  arg2, UINT arg3, UINT  arg4)
-{
-////    dprintf(("USER32:  GetMessage\n"));
-    return O32_GetMessage(arg1, arg2, arg3, arg4);
-}
 //******************************************************************************
 //******************************************************************************
@@ -1429,34 +1424,4 @@
 //******************************************************************************
 //******************************************************************************
-LONG WIN32API GetMessageExtraInfo(void)
-{
-    dprintf(("USER32:  GetMessageExtraInfo\n"));
-    return O32_GetMessageExtraInfo();
-}
-//******************************************************************************
-//******************************************************************************
-DWORD WIN32API GetMessagePos(void)
-{
-    dprintf(("USER32:  GetMessagePos\n"));
-    return O32_GetMessagePos();
-}
-//******************************************************************************
-//******************************************************************************
-LONG WIN32API GetMessageTime(void)
-{
-    dprintf(("USER32:  GetMessageTime\n"));
-    return O32_GetMessageTime();
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GetMessageW(LPMSG arg1, HWND arg2, UINT arg3, UINT arg4)
-{
- BOOL rc;
-
-    // NOTE: This will not work as is (needs UNICODE support)
-    rc = O32_GetMessage(arg1, arg2, arg3, arg4);
-    dprintf(("USER32:  GetMessageW %X returned %d\n", arg2, rc));
-    return(rc);
-}
 //******************************************************************************
 //******************************************************************************
Index: trunk/src/user32/new/win32type.h
===================================================================
--- trunk/src/user32/new/win32type.h	(revision 320)
+++ trunk/src/user32/new/win32type.h	(revision 321)
@@ -238,3 +238,22 @@
 } POINT, *PPOINT, *LPPOINT;
 
-#endif
+typedef struct tagRECT
+{
+    INT  left;
+    INT  top;
+    INT  right;
+    INT  bottom;
+} RECT, *PRECT, *LPRECT;
+typedef const RECT *LPCRECT;
+
+typedef struct
+{
+    HWND    hwnd;
+    UINT    message;
+    WPARAM  wParam;
+    LPARAM  lParam;
+    DWORD   time;
+    POINT   pt;
+} MSG, *LPMSG;
+
+#endif
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 320)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
+/* $Id: win32wnd.cpp,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -123,6 +123,12 @@
   if (cs->hwndParent)
   {
+    	Win32Window *window = GetWindowFromHandle(cs->hwndParent);
+    	if(!window) {
+                dprintf(("Bad parent %04x\n", cs->hwndParent ));
+                SetLastError(ERROR_INVALID_PARAMETER);
+		return FALSE;
+    	}
         /* Make sure parent is valid */
-        if (!IsWindow( cs->hwndParent ))
+        if (!window->IsWindow() )
         {
                 dprintf(("Bad parent %04x\n", cs->hwndParent ));
@@ -345,5 +351,14 @@
         return FALSE;
   }
-
+  if(OS2Hwnd != OS2HwndFrame) {
+  	if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
+        	dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2HwndFrame));
+        	return FALSE;
+  	}
+  	if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
+        	dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame));
+        	return FALSE;
+  	}
+  }
   /* Set the window menu */
   if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
@@ -415,5 +430,5 @@
 
 		NotifyParent(WM_CREATE, 0, 0);
-                if( !IsWindow(Win32Hwnd) )
+                if( !IsWindow() )
                 {
                     return FALSE;
@@ -975,7 +990,10 @@
   switch(hwndInsertAfter) {
   	case HWND_BOTTOM:
+		hwndInsertAfter = HWNDOS_BOTTOM;
+		break;
+	case HWND_TOPMOST: //TODO:
+	case HWND_NOTOPMOST: //TODO:
   	case HWND_TOP:
-	case HWND_TOPMOST:
-	case HWND_NOTOPMOST:
+		hwndInsertAfter = HWNDOS_TOP;
 		break;
 	default:
@@ -1023,11 +1041,4 @@
 }
 //******************************************************************************
-//TODO:
-//******************************************************************************
-HWND Win32Window::SetActiveWindow()
-{
-  return O32_SetActiveWindow(OS2Hwnd);
-}
-//******************************************************************************
 //******************************************************************************
 HWND Win32Window::GetParent()
@@ -1078,12 +1089,5 @@
 HWND Win32Window::GetTopWindow()
 {
- HWND topchild;
-
-  topchild = OSLibWinQueryTopMostChildWindow(OS2HwndFrame);
-  if(topchild)
-  {
-	return topchild;
-  }
-  else	return 0;
+  return GetWindow(GW_CHILD);
 }
 //******************************************************************************
@@ -1107,4 +1111,111 @@
 {
   return OSLibWinIsIconic(OS2HwndFrame);
+}
+//******************************************************************************
+//TODO: not complete nor correct (distinction between top-level, top-most & child windows)
+//******************************************************************************
+HWND Win32Window::GetWindow(UINT uCmd)
+{
+ Win32Window  *win32wnd;
+ ULONG         magic;
+ ULONG         getcmd = 0;
+ HWND          hwndRelated;
+
+  dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd));
+  switch(uCmd)
+  {
+	case GW_CHILD:
+		getcmd = QWOS_TOP;
+		break;
+	case GW_HWNDFIRST:
+		if(getParent()) {
+			getcmd = QWOS_TOP; //top of child windows
+		}
+		else	getcmd = QWOS_TOP; //TODO
+		break;
+	case GW_HWNDLAST:
+		if(getParent()) {
+			getcmd = QWOS_BOTTOM; //bottom of child windows
+		}
+		else	getcmd = QWOS_BOTTOM; //TODO
+		break;
+	case GW_HWNDNEXT:
+		getcmd = QWOS_NEXT;
+		break;
+	case GW_HWNDPREV:
+		getcmd = QWOS_PREV;
+		break;
+	case GW_OWNER:
+		if(owner) {
+			return owner->getWindowHandle();
+		}
+		else 	return 0;
+  }
+  hwndRelated = OSLibWinQueryWindow(OS2HwndFrame, getcmd);
+  if(hwndRelated) 
+  {
+	win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
+	magic    = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
+	if(CheckMagicDword(magic) && win32wnd)
+	{
+		return win32wnd->getWindowHandle();
+	}
+  }
+  return 0;
+}
+//******************************************************************************
+//******************************************************************************
+HWND Win32Window::SetActiveWindow()
+{
+  return OSLibWinSetActiveWindow(OS2HwndFrame);
+}
+//******************************************************************************
+//WM_ENABLE is sent to hwnd, but not to it's children (as it should be)
+//******************************************************************************
+BOOL Win32Window::EnableWindow(BOOL fEnable)
+{
+  return OSLibWinEnableWindow(OS2HwndFrame, fEnable);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL Win32Window::BringWindowToTop()
+{
+  return SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
+}
+//******************************************************************************
+//******************************************************************************
+HWND Win32Window::GetActiveWindow()
+{
+ HWND          hwndActive;
+ Win32Window  *win32wnd;
+ ULONG         magic;
+
+  hwndActive = OSLibWinQueryActiveWindow();
+
+  win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR);
+  magic    = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC);
+  if(CheckMagicDword(magic) && win32wnd)
+  {
+	return win32wnd->getWindowHandle();
+  }
+  return hwndActive;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL Win32Window::IsWindow()
+{
+  return TRUE;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL Win32Window::IsWindowEnabled()
+{
+  return OSLibWinIsWindowEnabled(OS2Hwnd);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL Win32Window::IsWindowVisible()
+{
+  return OSLibWinIsWindowVisible(OS2Hwnd);
 }
 //******************************************************************************
Index: trunk/src/user32/new/win32wnd.h
===================================================================
--- trunk/src/user32/new/win32wnd.h	(revision 320)
+++ trunk/src/user32/new/win32wnd.h	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.h,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
+/* $Id: win32wnd.h,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -24,5 +24,6 @@
 #define OFFSET_WIN32PM_MAGIC	4
 
-#define WIN32PM_MAGIC	0x12345678
+#define WIN32PM_MAGIC		0x12345678
+#define CheckMagicDword(a)	(a==WIN32PM_MAGIC)
 
 typedef struct {
@@ -96,4 +97,11 @@
 	 BOOL   UpdateWindow();
 	 BOOL   IsIconic();
+         HWND   GetWindow(UINT uCmd);
+	 BOOL   EnableWindow(BOOL fEnable);
+ 	 BOOL   BringWindowToTop();
+  static HWND   GetActiveWindow();
+	 BOOL   IsWindow();
+	 BOOL   IsWindowEnabled();
+	 BOOL   IsWindowVisible();
 
        LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
Index: trunk/src/user32/new/window.cpp
===================================================================
--- trunk/src/user32/new/window.cpp	(revision 320)
+++ trunk/src/user32/new/window.cpp	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: window.cpp,v 1.3 1999-07-16 11:32:09 sandervl Exp $ */
+/* $Id: window.cpp,v 1.4 1999-07-17 11:52:23 sandervl Exp $ */
 /*
  * Win32 window apis for OS/2
@@ -10,4 +10,7 @@
  *
  * Project Odin Software License can be found in LICENSE.TXT
+ *
+ *
+ * TODO: Decide what to do about commands for OS/2 windows (non-Win32 apps)
  *
  */
@@ -184,7 +187,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("DestroyWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("DestroyWindow %x", hwnd));
     return window->DestroyWindow();
 }
@@ -197,7 +201,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("SetActiveWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("SetActiveWindow %x", hwnd));
     return window->SetActiveWindow();
 }
@@ -210,7 +215,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("GetParent, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("GetParent %x", hwnd));
     return window->GetParent();
 }
@@ -223,7 +229,8 @@
     window = Win32Window::GetWindowFromHandle(hwndChild);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwndChild));
-	return 0;
-    }
+	dprintf(("SetParent, window %x not found", hwndChild));
+	return 0;
+    }
+    dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
     return window->SetParent(hwndNewParent);
 }
@@ -236,7 +243,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("IsChild, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("IsChild %x %x", hwndParent, hwnd));
     return window->IsChild(hwndParent);
 }
@@ -249,7 +257,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("GetTopWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("GetTopWindow %x", hwnd));
     return window->GetTopWindow();
 }
@@ -262,7 +271,8 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("UpdateWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("UpdateWindow %x", hwnd));
     return window->UpdateWindow();
 }
@@ -275,20 +285,23 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-	dprintf(("SendMessageA, window %x not found", hwnd));
-	return 0;
-    }
+	dprintf(("IsIconic, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("IsIconic %x", hwnd));
     return window->IsIconic();
 }
 //******************************************************************************
 //******************************************************************************
-HWND WIN32API GetWindow(HWND arg1, UINT arg2)
-{
- HWND rc;
-
-    rc = O32_GetWindow(arg1, arg2);
-#ifdef DEBUG
-    WriteLog("USER32:  GetWindow %X %d returned %d\n", arg1, arg2, rc);
-#endif
-    return(rc);
+HWND WIN32API GetWindow(HWND hwnd, UINT uCmd)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("GetWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("GetWindow %x %d", hwnd, uCmd));
+    return window->GetWindow(uCmd);
 }
 //******************************************************************************
@@ -303,19 +316,29 @@
 //******************************************************************************
 //******************************************************************************
-BOOL WIN32API EnableWindow( HWND arg1, BOOL  arg2)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  EnableWindow\n");
-#endif
-    return O32_EnableWindow(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API BringWindowToTop( HWND arg1)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  BringWindowToTop\n");
-#endif
-    return O32_BringWindowToTop(arg1);
+BOOL WIN32API EnableWindow( HWND hwnd, BOOL fEnable)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("EnableWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("EnableWindow %x %d", hwnd, fEnable));
+    return window->EnableWindow(fEnable);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API BringWindowToTop(HWND hwnd)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("BringWindowToTop, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("BringWindowToTop %x", hwnd));
+    return window->BringWindowToTop();
 }
 //******************************************************************************
@@ -323,23 +346,75 @@
 HWND WIN32API GetActiveWindow()
 {
-  return(O32_GetActiveWindow());
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API ShowWindow(HWND arg1, int arg2)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  ShowWindow %X %d\n", arg1, arg2);
-#endif
-    return O32_ShowWindow(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API SetWindowPos( HWND arg1, HWND arg2, int arg3, int arg4, int arg5, int arg6, UINT  arg7)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  SetWindowPos\n");
-#endif
-    return O32_SetWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+  return Win32Window::GetActiveWindow();
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API ShowWindow(HWND hwnd, int nCmdShow)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("ShowWindow, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("ShowWindow %x", hwnd));
+    return window->ShowWindow(nCmdShow);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API SetWindowPos(HWND hwnd, HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("SetWindowPos, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("SetWindowPos %x %x x=%d y=%d cx=%d cy=%d %x", hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
+    return window->SetWindowPos(hwndInsertAfter, x, y, cx, cy, fuFlags);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsWindow( HWND hwnd)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("IsWindow, window %x not found", hwnd));
+	return FALSE;
+    }
+    dprintf(("IsWindow %x", hwnd));
+    return window->IsWindow();
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsWindowEnabled( HWND hwnd)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("IsWindowEnabled, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("IsWindowEnabled %x", hwnd));
+    return window->IsWindowEnabled();
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API IsWindowVisible( HWND hwnd)
+{
+  Win32Window *window;
+
+    window = Win32Window::GetWindowFromHandle(hwnd);
+    if(!window) {
+	dprintf(("IsWindowVisible, window %x not found", hwnd));
+	return 0;
+    }
+    dprintf(("IsWindowVisible %x", hwnd));
+    return window->IsWindowVisible();
 }
 /***********************************************************************
@@ -364,31 +439,4 @@
     }
     return 0;
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API IsWindow( HWND arg1)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  IsWindow\n");
-#endif
-    return O32_IsWindow(arg1);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API IsWindowEnabled( HWND arg1)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  IsWindowEnabled\n");
-#endif
-    return O32_IsWindowEnabled(arg1);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API IsWindowVisible( HWND arg1)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  IsWindowVisible\n");
-#endif
-    return O32_IsWindowVisible(arg1);
 }
 //******************************************************************************
Index: trunk/src/user32/new/windowmsg.cpp
===================================================================
--- trunk/src/user32/new/windowmsg.cpp	(revision 320)
+++ trunk/src/user32/new/windowmsg.cpp	(revision 321)
@@ -1,3 +1,3 @@
-/* $Id: windowmsg.cpp,v 1.5 1999-07-16 11:32:10 sandervl Exp $ */
+/* $Id: windowmsg.cpp,v 1.6 1999-07-17 11:52:24 sandervl Exp $ */
 /*
  * Win32 window message APIs for OS/2
@@ -18,4 +18,5 @@
 #include <win.h>
 #include <hooks.h>
+#include "oslibwin.h"
 
 //******************************************************************************
@@ -24,54 +25,11 @@
 {
     dprintf(("USER32:  PostQuitMessage\n"));
-
-    O32_PostQuitMessage(nExitCode);
-}
-//******************************************************************************
-//******************************************************************************
-LONG WIN32API DispatchMessageA( const MSG * msg)
-{
-  LONG         retval;
-  int          painting;
-  Win32Window *window;
-    
-      /* Process timer messages */
-    if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
-    {
-	if (msg->lParam)
-        {
-	    return SendMessageA(msg->hwnd, msg->message, msg->wParam, GetTickCount());
-        }
-    }
-
-    if (!msg->hwnd) return 0;
-
-    window = Win32Window::GetWindowFromHandle(msg->hwnd);
-    if(!window) {
-	dprintf(("DispatchMessageA, window %x not found", msg->hwnd));
-	return 0;
-    }
-
-    painting = (msg->message == WM_PAINT);
-    if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT);
-
-    retval = window->SendMessageA(msg->message, msg->wParam, msg->lParam );
-
-#if 0
-    window = Win32Window::GetWindowFromHandle(msg->hwnd);
-    if(!window) {
-	dprintf(("DispatchMessageA, window %x not found", msg->hwnd));
-	return 0;
-    }
-
-    if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
-    {
-	ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 
-	    msg->hwnd);
-	wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
-        /* Validate the update region to avoid infinite WM_PAINT loop */
-        ValidateRect( msg->hwnd, NULL );
-    }
-#endif
-    return retval;
+    OSLibWinPostQuitMessage(nExitCode);
+}
+//******************************************************************************
+//******************************************************************************
+LONG WIN32API DispatchMessageA(const MSG * msg)
+{
+  return OSLibWinDispatchMsg((MSG *)msg);
 }
 //******************************************************************************
@@ -79,47 +37,5 @@
 LONG WIN32API DispatchMessageW( const MSG * msg)
 {
-  LONG         retval;
-  int          painting;
-  Win32Window *window;
-    
-    /* Process timer messages */
-    if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
-    {
-	if (msg->lParam)
-        {
-	    return SendMessageW(msg->hwnd, msg->message, msg->wParam, GetTickCount());
-        }
-    }
-
-    if (!msg->hwnd) return 0;
-
-    window = Win32Window::GetWindowFromHandle(msg->hwnd);
-    if(!window) {
-	dprintf(("DispatchMessageW, window %x not found", msg->hwnd));
-	return 0;
-    }
-
-    painting = (msg->message == WM_PAINT);
-    if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT);
-
-    retval = window->SendMessageW(msg->message, msg->wParam, msg->lParam );
-
-#if 0
-    window = Win32Window::GetWindowFromHandle(msg->hwnd);
-    if(!window) {
-	dprintf(("DispatchMessageW, window %x not found", msg->hwnd));
-	return 0;
-    }
-
-    if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
-    {
-	ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 
-	    msg->hwnd);
-	wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
-        /* Validate the update region to avoid infinite WM_PAINT loop */
-        ValidateRect( msg->hwnd, NULL );
-    }
-#endif
-    return retval;
+  return OSLibWinDispatchMsg((MSG *)msg, TRUE);
 }
 //******************************************************************************
@@ -127,8 +43,39 @@
 BOOL WIN32API TranslateMessage( const MSG * arg1)
 {
-#ifdef DEBUG
-////    WriteLog("USER32:  TranslateMessage\n");
-#endif
-    return O32_TranslateMessage(arg1);
+//    return O32_TranslateMessage(arg1);
+   return TRUE;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GetMessageA( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
+{
+    return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GetMessageW( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
+{
+    return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE);
+}
+//******************************************************************************
+//******************************************************************************
+LONG WIN32API GetMessageExtraInfo(void)
+{
+    dprintf(("USER32:  GetMessageExtraInfo\n"));
+    return O32_GetMessageExtraInfo();
+}
+//******************************************************************************
+//******************************************************************************
+DWORD WIN32API GetMessagePos(void)
+{
+    dprintf(("USER32:  GetMessagePos\n"));
+    return O32_GetMessagePos();
+}
+//******************************************************************************
+//******************************************************************************
+LONG WIN32API GetMessageTime(void)
+{
+    dprintf(("USER32:  GetMessageTime\n"));
+    return O32_GetMessageTime();
 }
 //******************************************************************************
