Index: trunk/src/user32/new/pmwindow.cpp
===================================================================
--- trunk/src/user32/new/pmwindow.cpp	(revision 649)
+++ trunk/src/user32/new/pmwindow.cpp	(revision 650)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.19 1999-08-22 08:30:52 sandervl Exp $ */
+/* $Id: pmwindow.cpp,v 1.20 1999-08-23 15:34:46 dengert Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -13,5 +13,5 @@
 #define INCL_GPI
 
-#include <os2.h>                        /* PM header file               */
+#include <os2.h>			/* PM header file		*/
 #include <os2wrap.h>
 #include <stdlib.h>
@@ -27,5 +27,5 @@
 #include "oslibmsg.h"
 
-HMQ  hmq = 0;                             /* Message queue handle         */
+HMQ  hmq = 0;				  /* Message queue handle	  */
 HAB  hab = 0;
 
@@ -45,23 +45,23 @@
   if(!hab || !hmq)
   {
-        UINT error;
-        //CB: only fail on real error
-        error = WinGetLastError(hab) & 0xFFFF; //error code
-        if (!hab || error != PMERR_MSG_QUEUE_ALREADY_EXISTS)
-        {
-            dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq));
-            dprintf((" Error = %x",error));
-            return(FALSE);
-        }
+	UINT error;
+	//CB: only fail on real error
+	error = WinGetLastError(hab) & 0xFFFF; //error code
+	if (!hab || error != PMERR_MSG_QUEUE_ALREADY_EXISTS)
+	{
+	    dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq));
+	    dprintf((" Error = %x",error));
+	    return(FALSE);
+	}
     else
-        {
-        if(!hab) {
-                hab = WinQueryAnchorBlock(HWND_DESKTOP);
-            dprintf(("WinQueryAnchorBlock returned %x", hab));
-        }
-        if(!hmq) {
-            hmq = HMQ_CURRENT;
-        }
-        }
+	{
+	if(!hab) {
+		hab = WinQueryAnchorBlock(HWND_DESKTOP);
+	    dprintf(("WinQueryAnchorBlock returned %x", hab));
+	}
+	if(!hmq) {
+	    hmq = HMQ_CURRENT;
+	}
+	}
   }
   SetThreadHAB(hab);
@@ -69,12 +69,12 @@
   SetThreadMessageQueue(hmq);
 
-  if(!WinRegisterClass(                 /* Register window class        */
-     hab,                               /* Anchor block handle          */
-     (PSZ)WIN32_STDCLASS,               /* Window class name            */
-     (PFNWP)Win32WindowProc,            /* Address of window procedure  */
+  if(!WinRegisterClass( 		/* Register window class	*/
+     hab,				/* Anchor block handle		*/
+     (PSZ)WIN32_STDCLASS,		/* Window class name		*/
+     (PFNWP)Win32WindowProc,		/* Address of window procedure	*/
      CS_SIZEREDRAW | CS_HITTEST,
      8)) {
-        dprintf(("WinRegisterClass Win32Window failed"));
-        return(FALSE);
+	dprintf(("WinRegisterClass Win32Window failed"));
+	return(FALSE);
    }
 
@@ -89,7 +89,7 @@
 {
  POSTMSG_PACKET *postmsg;
- OSLIBPOINT      point, ClientPoint;
- Win32Window    *win32wnd;
- APIRET          rc;
+ OSLIBPOINT	 point, ClientPoint;
+ Win32Window	*win32wnd;
+ APIRET 	 rc;
 
   //Restore our FS selector
@@ -99,6 +99,6 @@
 
   if(msg != WM_CREATE && win32wnd == NULL) {
-        dprintf(("Invalid win32wnd pointer for window %x!!", hwnd));
-        goto RunDefWndProc;
+	dprintf(("Invalid win32wnd pointer for window %x!!", hwnd));
+	goto RunDefWndProc;
   }
   switch( msg )
@@ -106,64 +106,64 @@
     //internal messages
     case WM_WIN32_POSTMESSAGEA:
-        postmsg = (POSTMSG_PACKET *)mp1;
-        if(postmsg == NULL) {
-            dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!"));
-            break;
-        }
-        win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);
-        free(postmsg);
-        break;
+	postmsg = (POSTMSG_PACKET *)mp1;
+	if(postmsg == NULL) {
+	    dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!"));
+	    break;
+	}
+	win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);
+	free(postmsg);
+	break;
 
     case WM_WIN32_POSTMESSAGEW:
-        postmsg = (POSTMSG_PACKET *)mp1;
-        if(postmsg == NULL) {
-            dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!"));
-            break;
-        }
-        win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);
-        free(postmsg);
-        break;
+	postmsg = (POSTMSG_PACKET *)mp1;
+	if(postmsg == NULL) {
+	    dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!"));
+	    break;
+	}
+	win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);
+	free(postmsg);
+	break;
 
     //OS/2 msgs
     case WM_CREATE:
-        //Processing is done in after WinCreateWindow returns
-        dprintf(("OS2: WM_CREATE %x", hwnd));
-        RestoreOS2TIB();
-        return (MRESULT)FALSE;
+	//Processing is done in after WinCreateWindow returns
+	dprintf(("OS2: WM_CREATE %x", hwnd));
+	RestoreOS2TIB();
+	return (MRESULT)FALSE;
 
     case WM_QUIT:
-        dprintf(("OS2: WM_QUIT %x", hwnd));
-        if(win32wnd->MsgQuit()) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_QUIT %x", hwnd));
+	if(win32wnd->MsgQuit()) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_CLOSE:
-        dprintf(("OS2: WM_CLOSE %x", hwnd));
-        if(win32wnd->MsgClose()) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_CLOSE %x", hwnd));
+	if(win32wnd->MsgClose()) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_DESTROY:
-        dprintf(("OS2: WM_DESTROY %x", hwnd));
-        if(win32wnd->MsgDestroy()) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_DESTROY %x", hwnd));
+	if(win32wnd->MsgDestroy()) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_ENABLE:
-        dprintf(("OS2: WM_ENABLE %x", hwnd));
-        if(win32wnd->MsgEnable((ULONG)mp1)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_ENABLE %x", hwnd));
+	if(win32wnd->MsgEnable((ULONG)mp1)) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_SHOW:
-        dprintf(("OS2: WM_SHOW %x", hwnd));
-        if(win32wnd->MsgShow((ULONG)mp1)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_SHOW %x", hwnd));
+	if(win32wnd->MsgShow((ULONG)mp1)) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_ADJUSTWINDOWPOS:
@@ -172,27 +172,27 @@
       PSWP     pswp = (PSWP)mp1;
 
-        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));
-
-        if(pswp->fl & SWP_MOVE) {
-            if(win32wnd->isChild()) {
-                x = pswp->x;
-                y = pswp->cy - y - 1;
-            }
-            else {
-                OSLIBPOINT point;
-
-                point.x = pswp->x;
-                point.y = pswp->y;
-
-                MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-                x = point.x;
-                y = point.y;
-            }
-            if(win32wnd->MsgMove(x, y)) {
-                goto RunDefWndProc;
-            }
-            break;
-        }
-        goto RunDefWndProc;
+	dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));
+
+	if(pswp->fl & SWP_MOVE) {
+	    if(win32wnd->isChild()) {
+		x = pswp->x;
+		y = pswp->cy - y - 1;
+	    }
+	    else {
+		OSLIBPOINT point;
+
+		point.x = pswp->x;
+		point.y = pswp->y;
+
+		MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+		x = point.x;
+		y = point.y;
+	    }
+	    if(win32wnd->MsgMove(x, y)) {
+		goto RunDefWndProc;
+	    }
+	    break;
+	}
+	goto RunDefWndProc;
     }
 
@@ -201,22 +201,11 @@
      PSWP pswp = (PSWP)mp1;
 
-        dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
-        goto RunDefWndProc;
+	dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
+	goto RunDefWndProc;
     }
 
     case WM_ERASEBACKGROUND:
     {
-     HPS hps;
-
-        dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd));
-        if(!win32wnd->MsgEraseBackGround())
-        {
-                /*
-                 * Return TRUE to request PM to paint the window background
-                 * in SYSCLR_WINDOW.
-                 */
-                return (MRESULT)( TRUE );
-        }
-        return (MRESULT) FALSE;
+	return (MRESULT) FALSE;
     }
     case WM_SIZE:
@@ -224,17 +213,17 @@
      SWP swp;
 
-        rc = WinQueryWindowPos(hwnd, &swp);
-        if(rc == FALSE) {
-                dprintf(("WM_SIZE: WinQueryWindowPos failed!"));
-                break;
-        }
-        dprintf(("OS2: WM_SIZE %x %x (%d,%d) (%d,%d) (%d,%d)", hwnd, swp.fl, swp.x, swp.y, swp.cx, swp.cy, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)));
-        if(win32wnd->MsgSize(SHORT1FROMMP(mp2), SHORT2FROMMP(mp2),
-                                (swp.fl & SWP_MINIMIZE) != 0,
-                                (swp.fl & SWP_MAXIMIZE) != 0))
-        {
-                goto RunDefWndProc;
-        }
-        break;
+	rc = WinQueryWindowPos(hwnd, &swp);
+	if(rc == FALSE) {
+		dprintf(("WM_SIZE: WinQueryWindowPos failed!"));
+		break;
+	}
+	dprintf(("OS2: WM_SIZE %x %x (%d,%d) (%d,%d) (%d,%d)", hwnd, swp.fl, swp.x, swp.y, swp.cx, swp.cy, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)));
+	if(win32wnd->MsgSize(SHORT1FROMMP(mp2), SHORT2FROMMP(mp2),
+				(swp.fl & SWP_MINIMIZE) != 0,
+				(swp.fl & SWP_MAXIMIZE) != 0))
+	{
+		goto RunDefWndProc;
+	}
+	break;
     }
 
@@ -243,18 +232,18 @@
       HWND hwndActivate = (HWND)mp1;
 
-        dprintf(("OS2: WM_ACTIVATE %x", hwnd));
-        if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
-                //another (non-win32) application's window
-                //set to NULL (allowed according to win32 SDK) to avoid problems
-                hwndActivate = NULL;
-        }
-        if(win32wnd->MsgActivate(1, hwndActivate)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_ACTIVATE %x", hwnd));
+	if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
+		//another (non-win32) application's window
+		//set to NULL (allowed according to win32 SDK) to avoid problems
+		hwndActivate = NULL;
+	}
+	if(win32wnd->MsgActivate(1, hwndActivate)) {
+		goto RunDefWndProc;
+	}
+	break;
     }
     case WM_FOCUSCHANGE:
-        dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
-        goto RunDefWndProc;
+	dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
+	goto RunDefWndProc;
 
     case WM_SETFOCUS:
@@ -262,18 +251,18 @@
       HWND hwndFocus = (HWND)mp1;
 
-        dprintf(("OS2: WM_SETFOCUS %x %d", hwnd, mp2));
-        if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
-                //another (non-win32) application's window
-                //set to NULL (allowed according to win32 SDK) to avoid problems
-                hwndFocus = NULL;
-        }
-        if((ULONG)mp2 == TRUE) {
-                rc = win32wnd->MsgSetFocus(hwndFocus);
-        }
-        else    rc = win32wnd->MsgKillFocus(hwndFocus);
-        if(rc) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_SETFOCUS %x %d", hwnd, mp2));
+	if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
+		//another (non-win32) application's window
+		//set to NULL (allowed according to win32 SDK) to avoid problems
+		hwndFocus = NULL;
+	}
+	if((ULONG)mp2 == TRUE) {
+		rc = win32wnd->MsgSetFocus(hwndFocus);
+	}
+	else	rc = win32wnd->MsgKillFocus(hwndFocus);
+	if(rc) {
+		goto RunDefWndProc;
+	}
+	break;
     }
     //**************************************************************************
@@ -281,96 +270,96 @@
     //**************************************************************************
     case WM_BUTTON1DOWN:
-        dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_LEFTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_LEFTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_BUTTON1UP:
-        dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_LEFTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_LEFTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON1DBLCLK:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON2DOWN:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON2UP:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_RIGHTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_RIGHTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON2DBLCLK:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON3DOWN:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON3UP:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_MIDDLEUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_MIDDLEUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
     case WM_BUTTON3DBLCLK:
-        point.x = (*(POINTS *)&mp1).x;
-        point.y = (*(POINTS *)&mp1).y;
-        ClientPoint.x = point.x;
-        ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
-        MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
-        if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
-                goto RunDefWndProc;
-        }
-        break;
+	point.x = (*(POINTS *)&mp1).x;
+	point.y = (*(POINTS *)&mp1).y;
+	ClientPoint.x = point.x;
+	ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
+	MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
+	if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_BUTTON2MOTIONSTART:
@@ -383,26 +372,26 @@
     case WM_BUTTON3MOTIONEND:
     case WM_BUTTON3CLICK:
-        goto RunDefWndProc;
+	goto RunDefWndProc;
 
     case WM_MOUSEMOVE:
     {
-        ULONG keystate = 0;
-        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
-            keystate |= WMMOVE_LBUTTON;
-        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
-            keystate |= WMMOVE_MBUTTON;
-        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
-            keystate |= WMMOVE_RBUTTON;
-        if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
-            keystate |= WMMOVE_SHIFT;
-        if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
-            keystate |= WMMOVE_CTRL;
-
-        //OS/2 Window coordinates -> Win32 Window coordinates
-        //TODO: What do windows apps that handle this messages return?
-        if(!win32wnd->MsgMouseMove(keystate, SHORT1FROMMP(mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(mp1)))) {
-                goto RunDefWndProc;
-        }
-        break;
+	ULONG keystate = 0;
+	if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
+	    keystate |= WMMOVE_LBUTTON;
+	if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
+	    keystate |= WMMOVE_MBUTTON;
+	if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
+	    keystate |= WMMOVE_RBUTTON;
+	if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
+	    keystate |= WMMOVE_SHIFT;
+	if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
+	    keystate |= WMMOVE_CTRL;
+
+	//OS/2 Window coordinates -> Win32 Window coordinates
+	//TODO: What do windows apps that handle this messages return?
+	if(!win32wnd->MsgMouseMove(keystate, SHORT1FROMMP(mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(mp1)))) {
+		goto RunDefWndProc;
+	}
+	break;
     }
 
@@ -416,12 +405,12 @@
 
     case WM_COMMAND:
-        if(SHORT1FROMMP(mp2) == CMDSRC_MENU) {
-            win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0);
-        }
-        if(SHORT1FROMMP(mp2) == CMDSRC_ACCELERATOR) {
-            win32wnd->MsgCommand(CMD_ACCELERATOR, SHORT1FROMMP(mp1), 0);
-        }
-        //todo controls + accelerators
-        break;
+	if(SHORT1FROMMP(mp2) == CMDSRC_MENU) {
+	    win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0);
+	}
+	if(SHORT1FROMMP(mp2) == CMDSRC_ACCELERATOR) {
+	    win32wnd->MsgCommand(CMD_ACCELERATOR, SHORT1FROMMP(mp1), 0);
+	}
+	//todo controls + accelerators
+	break;
 
     case WM_SYSCOMMAND:
@@ -430,41 +419,41 @@
       ULONG win32sc;
 
-        if(SHORT2FROMMP(mp2) == TRUE) {//syscommand caused by mouse action
-            POINTL pointl;
-            WinQueryPointerPos(HWND_DESKTOP, &pointl);
-            x = pointl.x;
-            y = desktopRectl.yTop - y;
-        }
-        switch(SHORT1FROMMP(mp1)) {
-        case SC_MOVE:
-            win32sc = WIN32SC_MOVE;
-            break;
-        case SC_CLOSE:
-            win32sc = WIN32SC_CLOSE;
-            break;
-        case SC_MAXIMIZE:
-            win32sc = WIN32SC_MAXIMIZE;
-            break;
-        case SC_MINIMIZE:
-            win32sc = WIN32SC_MINIMIZE;
-            break;
-        case SC_NEXTFRAME:
-        case SC_NEXTWINDOW:
-            win32sc = WIN32SC_NEXTWINDOW;
-            break;
-        case SC_RESTORE:
-            win32sc = WIN32SC_RESTORE;
-            break;
-        case SC_TASKMANAGER:
-            win32sc = WIN32SC_TASKLIST;
-            break;
-        default:
-            goto RunDefWndProc;
-        }
-        dprintf(("WM_SYSCOMMAND %x %x (%d,%d)", hwnd, win32sc, x, y));
-        if(win32wnd->MsgSysCommand(win32sc, x, y)) {
-            goto RunDefWndProc;
-        }
-        break;
+	if(SHORT2FROMMP(mp2) == TRUE) {//syscommand caused by mouse action
+	    POINTL pointl;
+	    WinQueryPointerPos(HWND_DESKTOP, &pointl);
+	    x = pointl.x;
+	    y = desktopRectl.yTop - y;
+	}
+	switch(SHORT1FROMMP(mp1)) {
+	case SC_MOVE:
+	    win32sc = WIN32SC_MOVE;
+	    break;
+	case SC_CLOSE:
+	    win32sc = WIN32SC_CLOSE;
+	    break;
+	case SC_MAXIMIZE:
+	    win32sc = WIN32SC_MAXIMIZE;
+	    break;
+	case SC_MINIMIZE:
+	    win32sc = WIN32SC_MINIMIZE;
+	    break;
+	case SC_NEXTFRAME:
+	case SC_NEXTWINDOW:
+	    win32sc = WIN32SC_NEXTWINDOW;
+	    break;
+	case SC_RESTORE:
+	    win32sc = WIN32SC_RESTORE;
+	    break;
+	case SC_TASKMANAGER:
+	    win32sc = WIN32SC_TASKLIST;
+	    break;
+	default:
+	    goto RunDefWndProc;
+	}
+	dprintf(("WM_SYSCOMMAND %x %x (%d,%d)", hwnd, win32sc, x, y));
+	if(win32wnd->MsgSysCommand(win32sc, x, y)) {
+	    goto RunDefWndProc;
+	}
+	break;
     }
     case WM_CHAR:
@@ -473,27 +462,27 @@
      ULONG fl = SHORT1FROMMP(mp1);
 
-        if(!(fl & KC_CHAR)) {
-            dprintf(("WM_CHAR: no valid character code"));
-            goto RunDefWndProc;
-        }
-        if(fl & KC_VIRTUALKEY) {
-            vkey = SHORT2FROMMP(mp2);
-        }
-        if(fl & KC_KEYUP) {
-            keyflags |= KEY_UP;
-        }
-        if(fl & KC_ALT) {
-            keyflags |= KEY_ALTDOWN;
-        }
-        if(fl & KC_PREVDOWN) {
-            keyflags |= KEY_PREVDOWN;
-        }
-        if(fl & KC_DEADKEY) {
-            keyflags |= KEY_DEADKEY;
-        }
-        if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
-            goto RunDefWndProc;
-        }
-        break;
+	if(!(fl & KC_CHAR)) {
+	    dprintf(("WM_CHAR: no valid character code"));
+	    goto RunDefWndProc;
+	}
+	if(fl & KC_VIRTUALKEY) {
+	    vkey = SHORT2FROMMP(mp2);
+	}
+	if(fl & KC_KEYUP) {
+	    keyflags |= KEY_UP;
+	}
+	if(fl & KC_ALT) {
+	    keyflags |= KEY_ALTDOWN;
+	}
+	if(fl & KC_PREVDOWN) {
+	    keyflags |= KEY_PREVDOWN;
+	}
+	if(fl & KC_DEADKEY) {
+	    keyflags |= KEY_DEADKEY;
+	}
+	if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
+	    goto RunDefWndProc;
+	}
+	break;
     }
     case WM_INITMENU:
@@ -503,5 +492,5 @@
 
     case WM_TIMER:
-        goto RunDefWndProc;
+	goto RunDefWndProc;
 
     case WM_SETWINDOWPARAMS:
@@ -509,11 +498,11 @@
       WNDPARAMS *wndParams = (WNDPARAMS *)mp1;
 
-        dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
-        if(wndParams->fsStatus & WPM_TEXT) {
-            if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
-                    goto RunDefWndProc;
-            }
-        }
-        goto RunDefWndProc;
+	dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
+	if(wndParams->fsStatus & WPM_TEXT) {
+	    if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
+		    goto RunDefWndProc;
+	    }
+	}
+	goto RunDefWndProc;
     }
 
@@ -524,26 +513,26 @@
      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;
+	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));
-        if(win32wnd->MsgPaint(0, 0)) {
-                goto RunDefWndProc;
-        }
-        break;
+	dprintf(("OS2: WM_PAINT %x", hwnd));
+	if(win32wnd->MsgPaint(0, 0)) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_HITTEST:
-        if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) {
-                goto RunDefWndProc;
-        }
-        break;
+	if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) {
+		goto RunDefWndProc;
+	}
+	break;
 
     case WM_SYSCOLORCHANGE:
@@ -569,7 +558,7 @@
     case WM_SEMANTICEVENT:
     default:
-//        dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
-        RestoreOS2TIB();
-        return WinDefWindowProc( hwnd, msg, mp1, mp2 );
+//	  dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
+	RestoreOS2TIB();
+	return WinDefWindowProc( hwnd, msg, mp1, mp2 );
   }
   RestoreOS2TIB();
Index: trunk/src/user32/new/spy.cpp
===================================================================
--- trunk/src/user32/new/spy.cpp	(revision 649)
+++ trunk/src/user32/new/spy.cpp	(revision 650)
@@ -1,3 +1,3 @@
-/* $Id: spy.cpp,v 1.2 1999-07-23 17:52:16 sandervl Exp $ */
+/* $Id: spy.cpp,v 1.3 1999-08-23 15:34:46 dengert Exp $ */
 
 /*
@@ -26,11 +26,11 @@
 
 
-#define  Q_BUFFER_SIZE  4096
-#define  MAX_MESSAGES   (Q_BUFFER_SIZE/sizeof(Q_SPYMSG))
+#define  Q_BUFFER_SIZE	4096
+#define  MAX_MESSAGES	(Q_BUFFER_SIZE/sizeof(Q_SPYMSG))
 
-PID       pidServer  = 0;
-HQUEUE    hqQueue    = 0;
+PID	  pidServer  = 0;
+HQUEUE	  hqQueue    = 0;
 Q_SPYMSG *pvdQMemory = 0;
-int       msgIndex   = 0;
+int	  msgIndex   = 0;
 
 BOOL InitSpyQueue()
@@ -38,13 +38,13 @@
  APIRET rc;
 
-   if (rc = DosOpenQueue(&pidServer, &hqQueue, "\\queues\\"Q_NAME))
+   if ((rc = DosOpenQueue(&pidServer, &hqQueue, "\\queues\\"Q_NAME)) != 0)
    {
 	dprintf(("InitSpyQueue: couldn't open spy queue rc=%d!", rc));
 	return FALSE;
    }
-   if (rc = DosAllocSharedMem((VOID **)&pvdQMemory,
-                         NULL,
-                         Q_BUFFER_SIZE,
-                         fALLOCSHR))
+   if ((rc = DosAllocSharedMem((VOID **)&pvdQMemory,
+			 NULL,
+			 Q_BUFFER_SIZE,
+			 fALLOCSHR)) != 0)
    {
 	dprintf(("InitSpyQueue: DosAllocSharedMem failed rc=%d", rc));
@@ -70,13 +70,13 @@
    if(hqQueue) {
 	if(pvdQMemory) {
-	  	rc = DosWriteQueue(hqQueue, Q_SPYMSG_KILLSERVER, 0, 0, 0);
+		rc = DosWriteQueue(hqQueue, Q_SPYMSG_KILLSERVER, 0, 0, 0);
 		if(rc) {
 			dprintf(("CloseSpyQueue: DosWriteQueue returned %d", rc));
 		}
 	}
-   	DosCloseQueue(hqQueue);
+	DosCloseQueue(hqQueue);
    }
    if(pvdQMemory)
-   	DosFreeMem(pvdQMemory);
+	DosFreeMem(pvdQMemory);
 }
 
@@ -88,5 +88,5 @@
    if (hqQueue == 0)
 	return FALSE;
-   
+
    pvdQMemory[msgIndex].hwnd   = hwnd;
    pvdQMemory[msgIndex].Msg    = Msg;
@@ -94,9 +94,9 @@
    pvdQMemory[msgIndex].lParam = lParam;
 
-   if (rc = DosWriteQueue(hqQueue,
-                     Q_SPYMSG_WNDMSG,
-                     sizeof(Q_SPYMSG),
-                     &pvdQMemory[msgIndex],
-                     0))
+   if ((rc = DosWriteQueue(hqQueue,
+		     Q_SPYMSG_WNDMSG,
+		     sizeof(Q_SPYMSG),
+		     &pvdQMemory[msgIndex],
+		     0)) != 0)
    {
 	hqQueue = 0; //give up, server probably died
@@ -104,5 +104,5 @@
 	return FALSE;
    }
-   if(++msgIndex >= MAX_MESSAGES) 
+   if(++msgIndex >= MAX_MESSAGES)
    {
 	msgIndex = 0;
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 649)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 650)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.28 1999-08-22 18:29:38 dengert Exp $ */
+/* $Id: win32wnd.cpp,v 1.29 1999-08-23 15:34:47 dengert Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -927,10 +927,10 @@
 //	(or are we simply erasing too much here)
 //******************************************************************************
-ULONG Win32Window::MsgEraseBackGround()
+ULONG Win32Window::MsgEraseBackGround(HDC hdc)
 {
     if(isIcon) {
-	    return SendInternalMessageA(WM_ICONERASEBKGND, GetDC(getWindowHandle()), 0);
-    }
-    else    return SendInternalMessageA(WM_ERASEBKGND, GetDC(getWindowHandle()), 0);
+	    return SendInternalMessageA(WM_ICONERASEBKGND, hdc, 0);
+    }
+    else    return SendInternalMessageA(WM_ERASEBKGND, hdc, 0);
 }
 //******************************************************************************
Index: trunk/src/user32/new/win32wnd.h
===================================================================
--- trunk/src/user32/new/win32wnd.h	(revision 649)
+++ trunk/src/user32/new/win32wnd.h	(revision 650)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.h,v 1.23 1999-08-22 08:30:53 sandervl Exp $ */
+/* $Id: win32wnd.h,v 1.24 1999-08-23 15:34:47 dengert Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -23,147 +23,147 @@
 class Win32Window;
 
-#define OFFSET_WIN32WNDPTR      0
-#define OFFSET_WIN32PM_MAGIC    4
-
-#define WIN32PM_MAGIC           0x12345678
-#define CheckMagicDword(a)      (a==WIN32PM_MAGIC)
+#define OFFSET_WIN32WNDPTR	0
+#define OFFSET_WIN32PM_MAGIC	4
+
+#define WIN32PM_MAGIC		0x12345678
+#define CheckMagicDword(a)	(a==WIN32PM_MAGIC)
 
 typedef struct {
-        USHORT          cb;
-        Win32Window    *win32wnd;
-        ULONG           win32CreateStruct;      //or dialog create dword
+	USHORT		cb;
+	Win32Window    *win32wnd;
+	ULONG		win32CreateStruct;	//or dialog create dword
 } CUSTOMWNDDATA;
 
 typedef struct
 {
-        ULONG           Msg;
-        ULONG           wParam;
-        ULONG           lParam;
+	ULONG		Msg;
+	ULONG		wParam;
+	ULONG		lParam;
 } POSTMSG_PACKET;
 
-#define WM_WIN32_POSTMESSAGEA   0x4000
-#define WM_WIN32_POSTMESSAGEW   0x4001
-
-#define MAX_WINDOW_NAMELENGTH   256
+#define WM_WIN32_POSTMESSAGEA	0x4000
+#define WM_WIN32_POSTMESSAGEW	0x4001
+
+#define MAX_WINDOW_NAMELENGTH	256
 
 class Win32Window : private GenericObject, private ChildWindow
 {
 public:
-        DWORD   magic;
-
-                Win32Window(DWORD objType);
-                Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
+	DWORD	magic;
+
+		Win32Window(DWORD objType);
+		Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
 virtual        ~Win32Window();
 
-virtual  ULONG  MsgCreate(HWND hwndOS2, ULONG initParam);
-         ULONG  MsgQuit();
-         ULONG  MsgClose();
-         ULONG  MsgDestroy();
-         ULONG  MsgEnable(BOOL fEnable);
-         ULONG  MsgShow(BOOL fShow);
-         ULONG  MsgMove(ULONG x, ULONG y);
-         ULONG  MsgHitTest(ULONG x, ULONG y);
-         ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
-         ULONG  MsgActivate(BOOL fActivate, HWND hwnd);
-         ULONG  MsgSetFocus(HWND hwnd);
-         ULONG  MsgKillFocus(HWND hwnd);
-         ULONG  MsgCommand(ULONG cmd, ULONG Id, HWND hwnd);
-         ULONG  MsgSysCommand(ULONG win32sc, ULONG x, ULONG y);
-         ULONG  MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags);
-         ULONG  MsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly);
-         ULONG  MsgMouseMove(ULONG keystate, ULONG x, ULONG y);
-         ULONG  MsgPaint(ULONG tmp1, ULONG tmp2);
-         ULONG  MsgEraseBackGround();
-         ULONG  MsgSetText(LPSTR lpsz, LONG cch);
-         ULONG  MsgGetTextLength();
-         char  *MsgGetText();
-
-virtual  LONG   SetWindowLongA(int index, ULONG value);
-virtual  ULONG  GetWindowLongA(int index);
-virtual  WORD   SetWindowWord(int index, WORD value);
-virtual  WORD   GetWindowWord(int index);
-
-         DWORD  getStyle()                      { return dwStyle; };
-         DWORD  getExStyle()                    { return dwExStyle; };
-         HWND   getWindowHandle()               { return Win32Hwnd; };
-         HWND   getOS2WindowHandle()            { return OS2Hwnd; };
-         HWND   getOS2FrameWindowHandle()       { return OS2HwndFrame; };
-         BOOL   isFrameWindow()                 { return OS2Hwnd != OS2HwndFrame; };
-   Win32Window *getParent()                     { return (Win32Window *)ChildWindow::GetParent(); };
-         void   setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };
-       WNDPROC  getWindowProc()                 { return win32wndproc; };
-         void   setWindowProc(WNDPROC newproc)  { win32wndproc = newproc; };
-        DWORD   getWindowId()                   { return windowId; };
-         void   setWindowId(DWORD id)           { windowId = id; };
-         ULONG  getWindowHeight()               { return rectClient.bottom - rectClient.top; };
-         BOOL   isChild();
-         PRECT  getClientRect()                 { return &rectClient; };
-         PRECT  getWindowRect()                 { return &rectWindow; };
-
-         DWORD  getFlags()                      { return flags; };
-         void   setFlags(DWORD newflags)        { flags = newflags; };
-
-         HACCEL GetAccelTable()                     { return (HACCEL) acceltableResource; };
-         BOOL   SetAccelTable(ULONG hAccel);
-
-         HMENU  GetMenu()                           { return (HMENU) menuResource; };
-         BOOL   SetMenu(ULONG hMenu);
-
-         BOOL   SetIcon(HICON hIcon);
-         HICON  GetIcon()                           { return (HICON) iconResource; };
-
-         BOOL   ShowWindow(ULONG nCmdShow);
-         BOOL   SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
-         BOOL   DestroyWindow();
-         HWND   SetActiveWindow();
-         HWND   GetParent();
-         HWND   SetParent(HWND hwndNewParent);
-         BOOL   IsChild(HWND hwndParent);
-         HWND   GetTopWindow();
-         BOOL   UpdateWindow();
-         BOOL   IsIconic();
-         HWND   GetWindow(UINT uCmd);
-         BOOL   EnableWindow(BOOL fEnable);
-         BOOL   CloseWindow();
-  static HWND   GetActiveWindow();
-         BOOL   IsWindow();
-         BOOL   IsWindowEnabled();
-         BOOL   IsWindowVisible();
-         BOOL   IsUnicode()  { return isUnicode; };
-
-         BOOL   GetWindowRect(PRECT pRect);
-         int    GetWindowTextLengthA();
-         int    GetWindowTextA(LPSTR lpsz, int cch);
-         BOOL   SetWindowTextA(LPCSTR lpsz);
-
-       LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
-       LRESULT  SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
-       BOOL     PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
-       BOOL     PostMessageW(ULONG 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);
+virtual  ULONG	MsgCreate(HWND hwndOS2, ULONG initParam);
+	 ULONG	MsgQuit();
+	 ULONG	MsgClose();
+	 ULONG	MsgDestroy();
+	 ULONG	MsgEnable(BOOL fEnable);
+	 ULONG	MsgShow(BOOL fShow);
+	 ULONG	MsgMove(ULONG x, ULONG y);
+	 ULONG	MsgHitTest(ULONG x, ULONG y);
+	 ULONG	MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
+	 ULONG	MsgActivate(BOOL fActivate, HWND hwnd);
+	 ULONG	MsgSetFocus(HWND hwnd);
+	 ULONG	MsgKillFocus(HWND hwnd);
+	 ULONG	MsgCommand(ULONG cmd, ULONG Id, HWND hwnd);
+	 ULONG	MsgSysCommand(ULONG win32sc, ULONG x, ULONG y);
+	 ULONG	MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags);
+	 ULONG	MsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly);
+	 ULONG	MsgMouseMove(ULONG keystate, ULONG x, ULONG y);
+	 ULONG	MsgPaint(ULONG tmp1, ULONG tmp2);
+	 ULONG	MsgEraseBackGround(HDC hdc);
+	 ULONG	MsgSetText(LPSTR lpsz, LONG cch);
+	 ULONG	MsgGetTextLength();
+	 char  *MsgGetText();
+
+virtual  LONG	SetWindowLongA(int index, ULONG value);
+virtual  ULONG	GetWindowLongA(int index);
+virtual  WORD	SetWindowWord(int index, WORD value);
+virtual  WORD	GetWindowWord(int index);
+
+	 DWORD	getStyle()			{ return dwStyle; };
+	 DWORD	getExStyle()			{ return dwExStyle; };
+	 HWND	getWindowHandle()		{ return Win32Hwnd; };
+	 HWND	getOS2WindowHandle()		{ return OS2Hwnd; };
+	 HWND	getOS2FrameWindowHandle()	{ return OS2HwndFrame; };
+	 BOOL	isFrameWindow() 		{ return OS2Hwnd != OS2HwndFrame; };
+   Win32Window *getParent()			{ return (Win32Window *)ChildWindow::GetParent(); };
+	 void	setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };
+       WNDPROC	getWindowProc() 		{ return win32wndproc; };
+	 void	setWindowProc(WNDPROC newproc)	{ win32wndproc = newproc; };
+	DWORD	getWindowId()			{ return windowId; };
+	 void	setWindowId(DWORD id)		{ windowId = id; };
+	 ULONG	getWindowHeight()		{ return rectClient.bottom - rectClient.top; };
+	 BOOL	isChild();
+	 PRECT	getClientRect() 		{ return &rectClient; };
+	 PRECT	getWindowRect() 		{ return &rectWindow; };
+
+	 DWORD	getFlags()			{ return flags; };
+	 void	setFlags(DWORD newflags)	{ flags = newflags; };
+
+	 HACCEL GetAccelTable() 		    { return (HACCEL) acceltableResource; };
+	 BOOL	SetAccelTable(ULONG hAccel);
+
+	 HMENU	GetMenu()			    { return (HMENU) menuResource; };
+	 BOOL	SetMenu(ULONG hMenu);
+
+	 BOOL	SetIcon(HICON hIcon);
+	 HICON	GetIcon()			    { return (HICON) iconResource; };
+
+	 BOOL	ShowWindow(ULONG nCmdShow);
+	 BOOL	SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
+	 BOOL	DestroyWindow();
+	 HWND	SetActiveWindow();
+	 HWND	GetParent();
+	 HWND	SetParent(HWND hwndNewParent);
+	 BOOL	IsChild(HWND hwndParent);
+	 HWND	GetTopWindow();
+	 BOOL	UpdateWindow();
+	 BOOL	IsIconic();
+	 HWND	GetWindow(UINT uCmd);
+	 BOOL	EnableWindow(BOOL fEnable);
+	 BOOL	CloseWindow();
+  static HWND	GetActiveWindow();
+	 BOOL	IsWindow();
+	 BOOL	IsWindowEnabled();
+	 BOOL	IsWindowVisible();
+	 BOOL	IsUnicode()  { return isUnicode; };
+
+	 BOOL	GetWindowRect(PRECT pRect);
+	 int	GetWindowTextLengthA();
+	 int	GetWindowTextA(LPSTR lpsz, int cch);
+	 BOOL	SetWindowTextA(LPCSTR lpsz);
+
+       LRESULT	SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
+       LRESULT	SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
+       BOOL	PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
+       BOOL	PostMessageW(ULONG 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);
 
 Win32WndClass  *getClass()  { return windowClass; };
 
-static   HWND  Win32ToOS2Handle(HWND hwnd)
+static	 HWND  Win32ToOS2Handle(HWND hwnd)
 {
  Win32Window *window = GetWindowFromHandle(hwnd);
 
   if(window) {
-        return window->getOS2WindowHandle();
+	return window->getOS2WindowHandle();
   }
-  else  return hwnd;    //OS/2 window handle
+  else	return hwnd;	//OS/2 window handle
 }
 
-static   HWND  OS2ToWin32Handle(HWND hwnd)
+static	 HWND  OS2ToWin32Handle(HWND hwnd)
 {
  Win32Window *window = GetWindowFromOS2Handle(hwnd);
 
   if(window) {
-        return window->getWindowHandle();
+	return window->getWindowHandle();
   }
-  else  return hwnd;    //OS/2 window handle
+  else	return hwnd;	//OS/2 window handle
 }
 
@@ -172,35 +172,35 @@
 
 protected:
-       LRESULT  SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
-       LRESULT  SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
-        void    Init();
-
-        HWND    OS2Hwnd;
-        HWND    OS2HwndFrame;
-        HWND    OS2HwndMenu;
-        HWND    Win32Hwnd;
-        BOOL    isUnicode;
-
-        int     posx, posy, width, height;
-
-        // values normally contained in the standard window words
-        ULONG   dwExStyle;              //GWL_EXSTYLE
-        ULONG   dwStyle;                //GWL_STYLE
-      WNDPROC   win32wndproc;           //GWL_WNDPROC
-        ULONG   hInstance;              //GWL_HINSTANCE
+       LRESULT	SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
+       LRESULT	SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
+	void	Init();
+
+	HWND	OS2Hwnd;
+	HWND	OS2HwndFrame;
+	HWND	OS2HwndMenu;
+	HWND	Win32Hwnd;
+	BOOL	isUnicode;
+
+	int	posx, posy, width, height;
+
+	// values normally contained in the standard window words
+	ULONG	dwExStyle;		//GWL_EXSTYLE
+	ULONG	dwStyle;		//GWL_STYLE
+      WNDPROC	win32wndproc;		//GWL_WNDPROC
+	ULONG	hInstance;		//GWL_HINSTANCE
 //Moved in ChildWindow class
-/////   Win32Window *parent;                    //GWL_HWNDPARENT
-        ULONG   windowId;               //GWL_ID
-        ULONG   userData;               //GWL_USERDATA
-
-         HWND   hwndLinkAfter;
-        DWORD   flags;
-        DWORD   lastHitTestVal;         //Last value returned by WM_NCHITTEST handler
-
-        BOOL    isIcon;
-        BOOL    fCreated;
-        BOOL    fFirstShow;
-
-   Win32Window *owner;                  
+/////	Win32Window *parent;			//GWL_HWNDPARENT
+	ULONG	windowId;		//GWL_ID
+	ULONG	userData;		//GWL_USERDATA
+
+	 HWND	hwndLinkAfter;
+	DWORD	flags;
+	DWORD	lastHitTestVal; 	//Last value returned by WM_NCHITTEST handler
+
+	BOOL	isIcon;
+	BOOL	fCreated;
+	BOOL	fFirstShow;
+
+   Win32Window *owner;
 
  Win32Resource *acceltableResource;
@@ -208,13 +208,13 @@
  Win32Resource *iconResource;
 
-        char    windowNameA[MAX_WINDOW_NAMELENGTH];
-        WCHAR   windowNameW[MAX_WINDOW_NAMELENGTH];
-        ULONG   wndNameLength;
-
-        ULONG  *userWindowLong;
-        ULONG   nrUserWindowLong;
-
-        RECT    rectWindow;
-        RECT    rectClient;
+	char	windowNameA[MAX_WINDOW_NAMELENGTH];
+	WCHAR	windowNameW[MAX_WINDOW_NAMELENGTH];
+	ULONG	wndNameLength;
+
+	ULONG  *userWindowLong;
+	ULONG	nrUserWindowLong;
+
+	RECT	rectWindow;
+	RECT	rectClient;
 
 Win32WndClass  *windowClass;
@@ -224,18 +224,18 @@
 private:
 #ifndef OS2_INCLUDED
-        BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
-
-        void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
-
-        LONG  SendNCCalcSize(BOOL calcValidRect,
-                             RECT *newWindowRect, RECT *oldWindowRect,
-                             RECT *oldClientRect, WINDOWPOS *winpos,
-                             RECT *newClientRect );
+	BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
+
+	void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
+
+	LONG  SendNCCalcSize(BOOL calcValidRect,
+			     RECT *newWindowRect, RECT *oldWindowRect,
+			     RECT *oldClientRect, WINDOWPOS *winpos,
+			     RECT *newClientRect );
 
      LRESULT  SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam)
      {
-        if(isUnicode)
-                return SendInternalMessageW(msg, wParam, lParam);
-        else    return SendInternalMessageA(msg, wParam, lParam);
+	if(isUnicode)
+		return SendInternalMessageW(msg, wParam, lParam);
+	else	return SendInternalMessageA(msg, wParam, lParam);
      }
 #endif
@@ -243,32 +243,32 @@
 
 
-#define BUTTON_LEFTDOWN         0
-#define BUTTON_LEFTUP           1
-#define BUTTON_LEFTDBLCLICK     2
-#define BUTTON_RIGHTUP          3
-#define BUTTON_RIGHTDOWN        4
-#define BUTTON_RIGHTDBLCLICK    5
-#define BUTTON_MIDDLEUP         6
-#define BUTTON_MIDDLEDOWN       7
-#define BUTTON_MIDDLEDBLCLICK   8
-
-#define WMMOVE_LBUTTON          1
-#define WMMOVE_MBUTTON          2
-#define WMMOVE_RBUTTON          4
-#define WMMOVE_CTRL             8
-#define WMMOVE_SHIFT            16
-
-
-#define CMD_MENU                1
-#define CMD_CONTROL             2
-#define CMD_ACCELERATOR         3
-
-#define WIN32SC_SIZE         0xf000
-#define WIN32SC_MOVE         0xf010
+#define BUTTON_LEFTDOWN 	0
+#define BUTTON_LEFTUP		1
+#define BUTTON_LEFTDBLCLICK	2
+#define BUTTON_RIGHTUP		3
+#define BUTTON_RIGHTDOWN	4
+#define BUTTON_RIGHTDBLCLICK	5
+#define BUTTON_MIDDLEUP 	6
+#define BUTTON_MIDDLEDOWN	7
+#define BUTTON_MIDDLEDBLCLICK	8
+
+#define WMMOVE_LBUTTON		1
+#define WMMOVE_MBUTTON		2
+#define WMMOVE_RBUTTON		4
+#define WMMOVE_CTRL		8
+#define WMMOVE_SHIFT		16
+
+
+#define CMD_MENU		1
+#define CMD_CONTROL		2
+#define CMD_ACCELERATOR 	3
+
+#define WIN32SC_SIZE	     0xf000
+#define WIN32SC_MOVE	     0xf010
 #define WIN32SC_MINIMIZE     0xf020
 #define WIN32SC_MAXIMIZE     0xf030
 #define WIN32SC_NEXTWINDOW   0xf040
 #define WIN32SC_PREVWINDOW   0xf050
-#define WIN32SC_CLOSE        0xf060
+#define WIN32SC_CLOSE	     0xf060
 #define WIN32SC_VSCROLL      0xf070
 #define WIN32SC_HSCROLL      0xf080
@@ -279,10 +279,10 @@
 #define WIN32SC_TASKLIST     0xf130
 #define WIN32SC_SCREENSAVE   0xf140
-#define WIN32SC_HOTKEY       0xf150
-
-#define KEY_ALTDOWN             1
-#define KEY_PREVDOWN            2
-#define KEY_UP                  4
-#define KEY_DEADKEY             8
+#define WIN32SC_HOTKEY	     0xf150
+
+#define KEY_ALTDOWN		1
+#define KEY_PREVDOWN		2
+#define KEY_UP			4
+#define KEY_DEADKEY		8
 
 #endif //__cplusplus
Index: trunk/src/user32/new/wingdi.cpp
===================================================================
--- trunk/src/user32/new/wingdi.cpp	(revision 649)
+++ trunk/src/user32/new/wingdi.cpp	(revision 650)
@@ -1,3 +1,3 @@
-/* $Id: wingdi.cpp,v 1.8 1999-07-25 15:51:57 sandervl Exp $ */
+/* $Id: wingdi.cpp,v 1.9 1999-08-23 15:34:47 dengert Exp $ */
 /*
  * Win32 Window graphics apis for OS/2
@@ -29,6 +29,6 @@
     window = Win32Window::GetWindowFromHandle(hwnd);
     if(!window) {
-        dprintf(("GetDC, window %x not found", hwnd));
-        return 0;
+	dprintf(("GetDC, window %x not found", hwnd));
+	return 0;
     }
 #ifdef OPEN32_GDI
@@ -40,4 +40,6 @@
 #endif
     dprintf(("BeginPaint %X returned %x\n", hwnd, hdc));
+
+    lps->fErase = !window->MsgEraseBackGround(hdc);
     return hdc;
 
@@ -65,8 +67,8 @@
    window = Win32Window::GetWindowFromHandle(hwnd);
    if(!window) {
-    	dprintf(("GetDC, window %x not found", hwnd));
+	dprintf(("GetDC, window %x not found", hwnd));
 #ifdef OPEN32_GDI
 	dprintf(("GetDC %x", hwnd));
-    	return O32_GetDC(0);
+	return O32_GetDC(0);
 #else
 	//desktop window?
