Index: trunk/src/user32/new/oslibwin.cpp
===================================================================
--- trunk/src/user32/new/oslibwin.cpp	(revision 627)
+++ trunk/src/user32/new/oslibwin.cpp	(revision 628)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.cpp,v 1.22 1999-08-20 20:09:51 sandervl Exp $ */
+/* $Id: oslibwin.cpp,v 1.23 1999-08-22 18:29:37 dengert Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -31,5 +31,5 @@
   if(hwndParent == OSLIB_HWND_DESKTOP)
   {
-        hwndParent = HWND_DESKTOP;
+	hwndParent = HWND_DESKTOP;
   }
 
@@ -39,5 +39,5 @@
 //******************************************************************************
 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
-                          char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
+			  char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
 {
  HWND  hwndClient;
@@ -46,34 +46,36 @@
 
   if(pszName && *pszName == 0) {
-        pszName = NULL;
+	pszName = NULL;
   }
   if(hwndParent == OSLIB_HWND_DESKTOP) {
-        hwndParent = HWND_DESKTOP;
+	hwndParent = HWND_DESKTOP;
   }
   if(Owner == OSLIB_HWND_DESKTOP) {
-        Owner = HWND_DESKTOP;
+	Owner = HWND_DESKTOP;
   }
 
   if(dwFrameStyle) {
-        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
-        if(pszName)
-                dwFrameStyle |= FCF_TITLEBAR;
-
-        dwFrameStyle |= FCF_TASKLIST;
-        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
-                                       &dwFrameStyle, WIN32_STDCLASS,
-                                       "", 0, 0, 0, &hwndClient);
-        if(*hwndFrame) {
-                if(pszName) {
-                        WinSetWindowText(*hwndFrame, pszName);
-                }
-                return hwndClient;
-        }
-        dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
-        return 0;
+	ULONG dwClientStyle;
+
+	dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP);
+	if(pszName)
+		dwFrameStyle |= FCF_TITLEBAR;
+
+	dwFrameStyle |= FCF_TASKLIST;
+	*hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
+				       &dwFrameStyle, WIN32_STDCLASS,
+				       "", dwClientStyle, 0, 0, &hwndClient);
+	if(*hwndFrame) {
+		if(pszName) {
+			WinSetWindowText(*hwndFrame, pszName);
+		}
+		return hwndClient;
+	}
+	dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
+	return 0;
   }
   hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, 0, 0, 0, 0,
-                               Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
-                               NULL);
+			       Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
+			       NULL);
   *hwndFrame = hwndClient;
   return hwndClient;
@@ -83,51 +85,51 @@
 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle)
 {
-  *OSWinStyle   = 0;
+  *OSWinStyle	= 0;
   *OSFrameStyle = 0;
 
   /* Window styles */
   if(dwStyle & WS_MINIMIZE_W)
-        *OSWinStyle |= WS_MINIMIZED;
+	*OSWinStyle |= WS_MINIMIZED;
 //Done explicitely in CreateWindowExA
 #if 0
   if(dwStyle & WS_VISIBLE_W)
-        *OSWinStyle |= WS_VISIBLE;
+	*OSWinStyle |= WS_VISIBLE;
 #endif
   if(dwStyle & WS_DISABLED_W)
-        *OSWinStyle |= WS_DISABLED;
+	*OSWinStyle |= WS_DISABLED;
   if(dwStyle & WS_CLIPSIBLINGS_W)
-        *OSWinStyle |= WS_CLIPSIBLINGS;
+	*OSWinStyle |= WS_CLIPSIBLINGS;
   if(dwStyle & WS_CLIPCHILDREN_W)
-        *OSWinStyle |= WS_CLIPCHILDREN;
+	*OSWinStyle |= WS_CLIPCHILDREN;
   if(dwStyle & WS_MAXIMIZE_W)
-        *OSWinStyle |= WS_MAXIMIZED;
+	*OSWinStyle |= WS_MAXIMIZED;
   if(dwStyle & WS_GROUP_W)
-        *OSWinStyle |= WS_GROUP;
+	*OSWinStyle |= WS_GROUP;
   if(dwStyle & WS_TABSTOP_W)
-        *OSWinStyle |= WS_TABSTOP;
+	*OSWinStyle |= WS_TABSTOP;
 
   if(dwStyle & WS_CAPTION_W)
-        *OSFrameStyle |= FCF_TITLEBAR;
+	*OSFrameStyle |= FCF_TITLEBAR;
   if(dwStyle & WS_DLGFRAME_W)
-        *OSFrameStyle |= FCF_DLGBORDER;
+	*OSFrameStyle |= FCF_DLGBORDER;
   else
   if(dwStyle & WS_BORDER_W)
-        *OSFrameStyle |= FCF_BORDER;
+	*OSFrameStyle |= FCF_BORDER;
 
   if(dwStyle & WS_VSCROLL_W)
-        *OSFrameStyle |= FCF_VERTSCROLL;
+	*OSFrameStyle |= FCF_VERTSCROLL;
   if(dwStyle & WS_HSCROLL_W)
-        *OSFrameStyle |= FCF_HORZSCROLL;
+	*OSFrameStyle |= FCF_HORZSCROLL;
   if(dwStyle & WS_SYSMENU_W)
-        *OSFrameStyle |= FCF_SYSMENU;
+	*OSFrameStyle |= FCF_SYSMENU;
   if(dwStyle & WS_THICKFRAME_W)
-        *OSFrameStyle |= FCF_SIZEBORDER;        //??
+	*OSFrameStyle |= FCF_SIZEBORDER;	//??
   if(dwStyle & WS_MINIMIZEBOX_W)
-        *OSFrameStyle |= FCF_MINBUTTON;
+	*OSFrameStyle |= FCF_MINBUTTON;
   if(dwStyle & WS_MAXIMIZEBOX_W)
-        *OSFrameStyle |= FCF_MAXBUTTON;
+	*OSFrameStyle |= FCF_MAXBUTTON;
 
   if(dwExStyle & WS_EX_DLGMODALFRAME_W)
-        *OSFrameStyle |= FCF_DLGBORDER;
+	*OSFrameStyle |= FCF_DLGBORDER;
 
   return TRUE;
@@ -224,5 +226,5 @@
 //******************************************************************************
 BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx,
-                          LONG cy, ULONG fl)
+			  LONG cy, ULONG fl)
 {
  HWND hwndParent = hwndInsertBehind;
@@ -230,12 +232,12 @@
 
     if(fl & SWP_MOVE) {
-        switch(hwndParent)
-        {
-            case HWNDOS_TOP:
-            case HWNDOS_BOTTOM:
-                hwndParent = HWND_DESKTOP;
-                break;
-        }
-        y = MapOS2ToWin32Y(hwndParent, cy, y);
+	switch(hwndParent)
+	{
+	    case HWNDOS_TOP:
+	    case HWNDOS_BOTTOM:
+		hwndParent = HWND_DESKTOP;
+		break;
+	}
+	y = MapOS2ToWin32Y(hwndParent, cy, y);
     }
     rc = WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
@@ -250,11 +252,11 @@
 
   if(fl & SWP_SHOW) {
-         rc = WinShowWindow(hwnd, TRUE);
+	 rc = WinShowWindow(hwnd, TRUE);
   }
   if(rc == 0)
-        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
+	dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
   rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl);
   if(rc == 0)
-        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
+	dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
   return rc;
 }
@@ -269,15 +271,15 @@
 BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo)
 {
- BOOL     rc;
+ BOOL	  rc;
  RECTLOS2 rectl;
 
   rc = WinQueryWindowRect(hwnd, (PRECTL)&rectl);
   if(rc) {
-        if(RelativeTo == RELATIVE_TO_SCREEN) {
-                MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect);
-        }
-        else    MapOS2ToWin32Rectl(&rectl, pRect);
-  }
-  else  memset(pRect, 0, sizeof(RECT));
+	if(RelativeTo == RELATIVE_TO_SCREEN) {
+		MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect);
+	}
+	else	MapOS2ToWin32Rectl(&rectl, pRect);
+  }
+  else	memset(pRect, 0, sizeof(RECT));
   return rc;
 }
@@ -291,11 +293,11 @@
   rc = WinQueryWindowPos(hwnd, &swp);
   if(rc == FALSE) {
-        dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));
-        return FALSE;
+	dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));
+	return FALSE;
   }
 
   if(swp.fl & SWP_MINIMIZE)
-        return TRUE;
-  else  return FALSE;
+	return TRUE;
+  else	return FALSE;
 }
 //******************************************************************************
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 627)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 628)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.27 1999-08-22 08:30:52 sandervl Exp $ */
+/* $Id: win32wnd.cpp,v 1.28 1999-08-22 18:29:38 dengert Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -57,5 +57,5 @@
 //******************************************************************************
 Win32Window::Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
-                        : GenericObject(&windows, OBJTYPE_WINDOW), ChildWindow()
+			: GenericObject(&windows, OBJTYPE_WINDOW), ChildWindow()
 {
   Init();
@@ -67,7 +67,7 @@
 void Win32Window::Init()
 {
-  isUnicode        = FALSE;
-  fCreated         = FALSE;
-  fFirstShow       = TRUE;
+  isUnicode	   = FALSE;
+  fCreated	   = FALSE;
+  fFirstShow	   = TRUE;
 
   memset(windowNameA, 0, MAX_WINDOW_NAMELENGTH);
@@ -78,38 +78,38 @@
   nrUserWindowLong = 0;
 
-  magic            = WIN32PM_MAGIC;
-  OS2Hwnd          = 0;
-  OS2HwndFrame     = 0;
-  OS2HwndMenu      = 0;
-  Win32Hwnd        = 0;
+  magic 	   = WIN32PM_MAGIC;
+  OS2Hwnd	   = 0;
+  OS2HwndFrame	   = 0;
+  OS2HwndMenu	   = 0;
+  Win32Hwnd	   = 0;
 
   if(HMHandleAllocate(&Win32Hwnd, (ULONG)this) != 0)
   {
-        dprintf(("Win32Window::Init HMHandleAllocate failed!!"));
-        DebugInt3();
-  }
-  Win32Hwnd       &= 0xFFFF;
-  Win32Hwnd       |= 0x68000000;
-
-  posx = posy      = 0;
+	dprintf(("Win32Window::Init HMHandleAllocate failed!!"));
+	DebugInt3();
+  }
+  Win32Hwnd	  &= 0xFFFF;
+  Win32Hwnd	  |= 0x68000000;
+
+  posx = posy	   = 0;
   width = height   = 0;
 
-  dwExStyle        = 0;
-  dwStyle          = 0;
-  win32wndproc     = 0;
-  hInstance        = 0;
-  windowId         = 0xFFFFFFFF;        //default = -1
-  userData         = 0;
+  dwExStyle	   = 0;
+  dwStyle	   = 0;
+  win32wndproc	   = 0;
+  hInstance	   = 0;
+  windowId	   = 0xFFFFFFFF;	//default = -1
+  userData	   = 0;
 
   hwndLinkAfter    = HWND_BOTTOM;
-  flags            = 0;
-  isIcon           = FALSE;
+  flags 	   = 0;
+  isIcon	   = FALSE;
   lastHitTestVal   = 0;
-  owner            = NULL;
-  windowClass      = 0;
+  owner 	   = NULL;
+  windowClass	   = 0;
 
   acceltableResource = NULL;
-  menuResource       = NULL;
-  iconResource       = NULL;
+  menuResource	     = NULL;
+  iconResource	     = NULL;
 }
 //******************************************************************************
@@ -122,7 +122,7 @@
 
   if(Win32Hwnd)
-        HMHandleFree(Win32Hwnd & 0xFFFF);
+	HMHandleFree(Win32Hwnd & 0xFFFF);
   if(userWindowLong)
-        free(userWindowLong);
+	free(userWindowLong);
 }
 //******************************************************************************
@@ -145,23 +145,23 @@
     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 (!window->IsWindow() )
-            {
-                    dprintf(("Bad parent %04x\n", cs->hwndParent ));
-                    SetLastError(ERROR_INVALID_PARAMETER);
-                    return FALSE;
-            }
+	    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 (!window->IsWindow() )
+	    {
+		    dprintf(("Bad parent %04x\n", cs->hwndParent ));
+		    SetLastError(ERROR_INVALID_PARAMETER);
+		    return FALSE;
+	    }
     }
     else
     if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) {
-            dprintf(("No parent for child window\n" ));
-            SetLastError(ERROR_INVALID_PARAMETER);
-            return FALSE;  /* WS_CHILD needs a parent, but WS_POPUP doesn't */
+	    dprintf(("No parent for child window\n" ));
+	    SetLastError(ERROR_INVALID_PARAMETER);
+	    return FALSE;  /* WS_CHILD needs a parent, but WS_POPUP doesn't */
     }
 
@@ -170,7 +170,7 @@
   if (!windowClass)
   {
-        GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
-        dprintf(("Bad class '%s'\n", buffer ));
-        return 0;
+	GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
+	dprintf(("Bad class '%s'\n", buffer ));
+	return 0;
   }
 
@@ -180,11 +180,11 @@
    */
   if (!HIWORD(cs->lpszClass) ) {
-        if (isUnicode) {
-                GlobalGetAtomNameW( classAtom, (LPWSTR)buffer, sizeof(buffer) );
-        }
-        else {
-                GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
-        }
-        cs->lpszClass = buffer;
+	if (isUnicode) {
+		GlobalGetAtomNameW( classAtom, (LPWSTR)buffer, sizeof(buffer) );
+	}
+	else {
+		GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
+	}
+	cs->lpszClass = buffer;
   }
 
@@ -192,53 +192,53 @@
   if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16)
   {
-//        PDB *pdb = PROCESS_Current();
+//	  PDB *pdb = PROCESS_Current();
 
        /* Never believe Microsoft's documentation... CreateWindowEx doc says
-        * that if an overlapped window is created with WS_VISIBLE style bit
-        * set and the x parameter is set to CW_USEDEFAULT, the system ignores
-        * the y parameter. However, disassembling NT implementation (WIN32K.SYS)
-        * reveals that
-        *
-        * 1) not only if checks for CW_USEDEFAULT but also for CW_USEDEFAULT16
-        * 2) it does not ignore the y parameter as the docs claim; instead, it
-        *    uses it as second parameter to ShowWindow() unless y is either
-        *    CW_USEDEFAULT or CW_USEDEFAULT16.
-        *
-        * The fact that we didn't do 2) caused bogus windows pop up when wine
-        * was running apps that were using this obscure feature. Example -
-        * calc.exe that comes with Win98 (only Win98, it's different from
-        * the one that comes with Win95 and NT)
-        */
-        if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) sw = cs->y;
-
-        /* We have saved cs->y, now we can trash it */
+	* that if an overlapped window is created with WS_VISIBLE style bit
+	* set and the x parameter is set to CW_USEDEFAULT, the system ignores
+	* the y parameter. However, disassembling NT implementation (WIN32K.SYS)
+	* reveals that
+	*
+	* 1) not only if checks for CW_USEDEFAULT but also for CW_USEDEFAULT16
+	* 2) it does not ignore the y parameter as the docs claim; instead, it
+	*    uses it as second parameter to ShowWindow() unless y is either
+	*    CW_USEDEFAULT or CW_USEDEFAULT16.
+	*
+	* The fact that we didn't do 2) caused bogus windows pop up when wine
+	* was running apps that were using this obscure feature. Example -
+	* calc.exe that comes with Win98 (only Win98, it's different from
+	* the one that comes with Win95 and NT)
+	*/
+	if (cs->y != CW_USEDEFAULT && cs->y != CW_USEDEFAULT16) sw = cs->y;
+
+	/* We have saved cs->y, now we can trash it */
 #if 0
-        if (   !(cs->style & (WS_CHILD | WS_POPUP))
-            &&  (pdb->env_db->startup_info->dwFlags & STARTF_USEPOSITION) )
-        {
-            cs->x = pdb->env_db->startup_info->dwX;
-            cs->y = pdb->env_db->startup_info->dwY;
-        }
+	if (   !(cs->style & (WS_CHILD | WS_POPUP))
+	    &&	(pdb->env_db->startup_info->dwFlags & STARTF_USEPOSITION) )
+	{
+	    cs->x = pdb->env_db->startup_info->dwX;
+	    cs->y = pdb->env_db->startup_info->dwY;
+	}
 #endif
-            cs->x = 0;
-            cs->y = 0;
-//        }
+	    cs->x = 0;
+	    cs->y = 0;
+//	  }
   }
   if (cs->cx == CW_USEDEFAULT || cs->cx == CW_USEDEFAULT16)
   {
 #if 0
-        PDB *pdb = PROCESS_Current();
-        if (   !(cs->style & (WS_CHILD | WS_POPUP))
-            &&  (pdb->env_db->startup_info->dwFlags & STARTF_USESIZE) )
-        {
-            cs->cx = pdb->env_db->startup_info->dwXSize;
-            cs->cy = pdb->env_db->startup_info->dwYSize;
-        }
-        else
-        {
+	PDB *pdb = PROCESS_Current();
+	if (   !(cs->style & (WS_CHILD | WS_POPUP))
+	    &&	(pdb->env_db->startup_info->dwFlags & STARTF_USESIZE) )
+	{
+	    cs->cx = pdb->env_db->startup_info->dwXSize;
+	    cs->cy = pdb->env_db->startup_info->dwYSize;
+	}
+	else
+	{
 #endif
-            cs->cx = 600; /* FIXME */
-            cs->cy = 400;
-//        }
+	    cs->cx = 600; /* FIXME */
+	    cs->cy = 400;
+//	  }
   }
 
@@ -249,26 +249,26 @@
   nrUserWindowLong = windowClass->getExtraWndWords();
   if(nrUserWindowLong) {
-        userWindowLong = (ULONG *)malloc(nrUserWindowLong);
-        memset(userWindowLong, 0, nrUserWindowLong);
+	userWindowLong = (ULONG *)malloc(nrUserWindowLong);
+	memset(userWindowLong, 0, nrUserWindowLong);
   }
 
   if ((cs->style & WS_CHILD) && cs->hwndParent)
   {
-        SetParent(cs->hwndParent);
+	SetParent(cs->hwndParent);
   }
   else
   {
-        if (!cs->hwndParent) {
-            owner = NULL;
-        }
-        else
-        {
-            owner = GetWindowFromHandle(cs->hwndParent);
-            if(owner == NULL)
-            {
-                dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
-                return FALSE;
-            }
-        }
+	if (!cs->hwndParent) {
+	    owner = NULL;
+	}
+	else
+	{
+	    owner = GetWindowFromHandle(cs->hwndParent);
+	    if(owner == NULL)
+	    {
+		dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
+		return FALSE;
+	    }
+	}
   }
 
@@ -279,5 +279,5 @@
 
   hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
-                  ? HWND_BOTTOM : HWND_TOP;
+		  ? HWND_BOTTOM : HWND_TOP;
 
 #if 0
@@ -288,16 +288,16 @@
     {
     CBT_CREATEWNDA cbtc;
-        LRESULT ret;
+	LRESULT ret;
 
     cbtc.lpcs = cs;
     cbtc.hwndInsertAfter = hwndLinkAfter;
-        ret = unicode ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc)
-                      : HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc);
-        if (ret)
+	ret = unicode ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc)
+		      : HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc);
+	if (ret)
     {
-        TRACE_(win)("CBT-hook returned 0\n");
-        wndPtr->pDriver->pFinalize(wndPtr);
-            retvalue =  0;
-            goto end;
+	TRACE_(win)("CBT-hook returned 0\n");
+	wndPtr->pDriver->pFinalize(wndPtr);
+	    retvalue =	0;
+	    goto end;
     }
     }
@@ -310,10 +310,10 @@
   if (!(cs->style & WS_CHILD))
   {
-        dwStyle |= WS_CLIPSIBLINGS;
-        if (!(cs->style & WS_POPUP))
-        {
-            dwStyle |= WS_CAPTION;
-            flags |= WIN_NEED_SIZE;
-        }
+	dwStyle |= WS_CLIPSIBLINGS;
+	if (!(cs->style & WS_POPUP))
+	{
+	    dwStyle |= WS_CAPTION;
+	    flags |= WIN_NEED_SIZE;
+	}
   }
   if (cs->dwExStyle & WS_EX_DLGMODALFRAME) dwStyle &= ~WS_THICKFRAME;
@@ -330,20 +330,20 @@
   if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
   {
-        GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack);
-        if (maxSize.x < cs->cx) cs->cx = maxSize.x;
-        if (maxSize.y < cs->cy) cs->cy = maxSize.y;
-        if (cs->cx < minTrack.x ) cs->cx = minTrack.x;
-        if (cs->cy < minTrack.y ) cs->cy = minTrack.y;
+	GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack);
+	if (maxSize.x < cs->cx) cs->cx = maxSize.x;
+	if (maxSize.y < cs->cy) cs->cy = maxSize.y;
+	if (cs->cx < minTrack.x ) cs->cx = minTrack.x;
+	if (cs->cy < minTrack.y ) cs->cy = minTrack.y;
   }
 
   if(cs->style & WS_CHILD)
   {
-        if(cs->cx < 0) cs->cx = 0;
-        if(cs->cy < 0) cs->cy = 0;
+	if(cs->cx < 0) cs->cx = 0;
+	if(cs->cy < 0) cs->cy = 0;
   }
   else
   {
-        if (cs->cx <= 0) cs->cx = 1;
-        if (cs->cy <= 0) cs->cy = 1;
+	if (cs->cx <= 0) cs->cx = 1;
+	if (cs->cy <= 0) cs->cy = 1;
   }
 
@@ -352,5 +352,5 @@
   rectWindow.right  = cs->x + cs->cx;
   rectWindow.bottom = cs->y + cs->cy;
-  rectClient        = rectWindow;
+  rectClient	    = rectWindow;
 
   DWORD dwOSWinStyle, dwOSFrameStyle;
@@ -361,36 +361,36 @@
 #if 1
   if(cs->style & WS_CHILD) {
-        dwOSFrameStyle = 0;
+	dwOSFrameStyle = 0;
   }
 #endif
 
-  OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2FrameWindowHandle() : OSLIB_HWND_DESKTOP,
-                                 dwOSWinStyle, dwOSFrameStyle, (char *)cs->lpszName,
-                                 (owner) ? owner->getOS2FrameWindowHandle() : OSLIB_HWND_DESKTOP,
-                                 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE,
-                                 &OS2HwndFrame);
+  OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP,
+				 dwOSWinStyle, dwOSFrameStyle, (char *)cs->lpszName,
+				 (owner) ? owner->getOS2FrameWindowHandle() : OSLIB_HWND_DESKTOP,
+				 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE,
+				 &OS2HwndFrame);
 
   if(OS2Hwnd == 0) {
-        dprintf(("Window creation failed!!"));
-        return FALSE;
+	dprintf(("Window creation failed!!"));
+	return FALSE;
   }
 
   if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
-        dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
-        return FALSE;
+	dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
+	return FALSE;
   }
   if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
-        dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
-        return FALSE;
+	dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
+	return FALSE;
   }
 #if 0
   if(OS2Hwnd != OS2HwndFrame) {
     if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
-            dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2HwndFrame));
-            return 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;
+	    dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame));
+	    return FALSE;
     }
   }
@@ -400,30 +400,30 @@
   if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
   {
-        if (cs->hMenu) SetMenu(cs->hMenu);
-        else
-        {
-                if (windowClass->getMenuNameA()) {
-                        cs->hMenu = LoadMenuA(cs->hInstance, windowClass->getMenuNameA());
-                        if (cs->hMenu) SetMenu(cs->hMenu );
-                }
-        }
-  }
-  else  windowId = (UINT)cs->hMenu;
+	if (cs->hMenu) SetMenu(cs->hMenu);
+	else
+	{
+		if (windowClass->getMenuNameA()) {
+			cs->hMenu = LoadMenuA(cs->hInstance, windowClass->getMenuNameA());
+			if (cs->hMenu) SetMenu(cs->hMenu );
+		}
+	}
+  }
+  else	windowId = (UINT)cs->hMenu;
 
   //Set icon from class
   if(windowClass->getIcon())
-        SetIcon(windowClass->getIcon());
+	SetIcon(windowClass->getIcon());
 
   if(getParent()) {
-        SetWindowPos(getParent()->getWindowHandle(), rectClient.left, rectClient.top,
-                     rectClient.right-rectClient.left,
-                     rectClient.bottom-rectClient.top,
-                     SWP_NOACTIVATE);
+	SetWindowPos(getParent()->getWindowHandle(), rectClient.left, rectClient.top,
+		     rectClient.right-rectClient.left,
+		     rectClient.bottom-rectClient.top,
+		     SWP_NOACTIVATE | SWP_NOZORDER);
   }
   else {
-        SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
-                     rectClient.right-rectClient.left,
-                     rectClient.bottom-rectClient.top,
-                     SWP_NOACTIVATE);
+	SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
+		     rectClient.right-rectClient.left,
+		     rectClient.bottom-rectClient.top,
+		     SWP_NOACTIVATE);
   }
   //Get the client window rectangle
@@ -439,29 +439,29 @@
   if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) )
   {
-        //doesn't work right, messes up client rectangle
+	//doesn't work right, messes up client rectangle
 #if 0
-        SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
+	SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
 #endif
-        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
-        dprintf(("Sending WM_CREATE"));
-        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 ) );
-            }
-            if (cs->style & WS_VISIBLE) ShowWindow( sw );
+	OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
+	dprintf(("Sending WM_CREATE"));
+	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 ) );
+	    }
+	    if (cs->style & WS_VISIBLE) ShowWindow( sw );
 
 #if 0
-            /* Call WH_SHELL hook */
-
-            if (!(dwStyle & WS_CHILD) && !owner)
-                HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
+	    /* Call WH_SHELL hook */
+
+	    if (!(dwStyle & WS_CHILD) && !owner)
+		HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
 #endif
-            SetLastError(0);
-            return TRUE;
-        }
+	    SetLastError(0);
+	    return TRUE;
+	}
   }
   fCreated = FALSE;
@@ -473,5 +473,5 @@
 #if 0
 /***********************************************************************
- *           WINPOS_MinMaximize
+ *	     WINPOS_MinMaximize
  *
  * Fill in lpRect and return additional flags to be used with SetWindowPos().
@@ -492,83 +492,83 @@
     if( dwStyle & WS_MINIMIZE )
     {
-        if( !SendInternalMessageA(WM_QUERYOPEN, 0, 0L ) )
-        return (SWP_NOSIZE | SWP_NOMOVE);
-        swpFlags |= SWP_NOCOPYBITS;
+	if( !SendInternalMessageA(WM_QUERYOPEN, 0, 0L ) )
+	return (SWP_NOSIZE | SWP_NOMOVE);
+	swpFlags |= SWP_NOCOPYBITS;
     }
     switch( cmd )
     {
-        case SW_MINIMIZE:
-         if( dwStyle & WS_MAXIMIZE)
-         {
-             flags |= WIN_RESTORE_MAX;
-             dwStyle &= ~WS_MAXIMIZE;
-                 }
-                 else
-             flags &= ~WIN_RESTORE_MAX;
-             dwStyle |= WS_MINIMIZE;
+	case SW_MINIMIZE:
+	 if( dwStyle & WS_MAXIMIZE)
+	 {
+	     flags |= WIN_RESTORE_MAX;
+	     dwStyle &= ~WS_MAXIMIZE;
+		 }
+		 else
+	     flags &= ~WIN_RESTORE_MAX;
+	     dwStyle |= WS_MINIMIZE;
 
 #if 0
-         if( flags & WIN_NATIVE )
-             if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, TRUE ) )
-             swpFlags |= MINMAX_NOSWP;
+	 if( flags & WIN_NATIVE )
+	     if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, TRUE ) )
+	     swpFlags |= MINMAX_NOSWP;
 #endif
 
-         lpPos->ptIconPos = WINPOS_FindIconPos( wndPtr, lpPos->ptIconPos );
-
-         SetRect(lpRect, lpPos->ptIconPos.x, lpPos->ptIconPos.y,
-             GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) );
-         swpFlags |= SWP_NOCOPYBITS;
-         break;
-
-        case SW_MAXIMIZE:
-                WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL );
-
-         if( dwStyle & WS_MINIMIZE )
-         {
-             if( flags & WIN_NATIVE )
-             if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, FALSE ) )
-                 swpFlags |= MINMAX_NOSWP;
-
-             WINPOS_ShowIconTitle( wndPtr, FALSE );
-             dwStyle &= ~WS_MINIMIZE;
-         }
-                 dwStyle |= WS_MAXIMIZE;
-
-         SetRect16( lpRect, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y,
-                    size.x, size.y );
-         break;
-
-        case SW_RESTORE:
-         if( dwStyle & WS_MINIMIZE )
-         {
-             if( flags & WIN_NATIVE )
-             if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, FALSE ) )
-                 swpFlags |= MINMAX_NOSWP;
-
-             dwStyle &= ~WS_MINIMIZE;
-             WINPOS_ShowIconTitle( wndPtr, FALSE );
-
-             if( flags & WIN_RESTORE_MAX)
-             {
-             /* Restore to maximized position */
-                         CONV_POINT16TO32( &lpPos->ptMaxPos, &pt );
-                         WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL);
-                         CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
-             dwStyle |= WS_MAXIMIZE;
-             SetRect16( lpRect, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y, size.x, size.y );
-             break;
-             }
-         }
-         else
-             if( !(dwStyle & WS_MAXIMIZE) ) return (UINT16)(-1);
-             else dwStyle &= ~WS_MAXIMIZE;
-
-         /* Restore to normal position */
-
-        *lpRect = lpPos->rectNormal;
-         lpRect->right -= lpRect->left;
-         lpRect->bottom -= lpRect->top;
-
-         break;
+	 lpPos->ptIconPos = WINPOS_FindIconPos( wndPtr, lpPos->ptIconPos );
+
+	 SetRect(lpRect, lpPos->ptIconPos.x, lpPos->ptIconPos.y,
+	     GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) );
+	 swpFlags |= SWP_NOCOPYBITS;
+	 break;
+
+	case SW_MAXIMIZE:
+		WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL );
+
+	 if( dwStyle & WS_MINIMIZE )
+	 {
+	     if( flags & WIN_NATIVE )
+	     if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, FALSE ) )
+		 swpFlags |= MINMAX_NOSWP;
+
+	     WINPOS_ShowIconTitle( wndPtr, FALSE );
+	     dwStyle &= ~WS_MINIMIZE;
+	 }
+		 dwStyle |= WS_MAXIMIZE;
+
+	 SetRect16( lpRect, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y,
+		    size.x, size.y );
+	 break;
+
+	case SW_RESTORE:
+	 if( dwStyle & WS_MINIMIZE )
+	 {
+	     if( flags & WIN_NATIVE )
+	     if( pDriver->pSetHostAttr( wndPtr, HAK_ICONICSTATE, FALSE ) )
+		 swpFlags |= MINMAX_NOSWP;
+
+	     dwStyle &= ~WS_MINIMIZE;
+	     WINPOS_ShowIconTitle( wndPtr, FALSE );
+
+	     if( flags & WIN_RESTORE_MAX)
+	     {
+	     /* Restore to maximized position */
+			 CONV_POINT16TO32( &lpPos->ptMaxPos, &pt );
+			 WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL);
+			 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
+	     dwStyle |= WS_MAXIMIZE;
+	     SetRect16( lpRect, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y, size.x, size.y );
+	     break;
+	     }
+	 }
+	 else
+	     if( !(dwStyle & WS_MAXIMIZE) ) return (UINT16)(-1);
+	     else dwStyle &= ~WS_MAXIMIZE;
+
+	 /* Restore to normal position */
+
+	*lpRect = lpPos->rectNormal;
+	 lpRect->right -= lpRect->left;
+	 lpRect->bottom -= lpRect->top;
+
+	 break;
     }
     } else swpFlags |= SWP_NOSIZE | SWP_NOMOVE;
@@ -577,10 +577,10 @@
 #endif
 /*******************************************************************
- *           GetMinMaxInfo
+ *	     GetMinMaxInfo
  *
  * Get the minimized and maximized information for a window.
  */
 void Win32Window::GetMinMaxInfo(POINT *maxSize, POINT *maxPos,
-                                POINT *minTrack, POINT *maxTrack )
+				POINT *minTrack, POINT *maxTrack )
 {
     MINMAXINFO MinMax;
@@ -599,20 +599,20 @@
     else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
     {
-        xinc = GetSystemMetrics(SM_CXDLGFRAME);
-        yinc = GetSystemMetrics(SM_CYDLGFRAME);
+	xinc = GetSystemMetrics(SM_CXDLGFRAME);
+	yinc = GetSystemMetrics(SM_CYDLGFRAME);
     }
     else
     {
-        xinc = yinc = 0;
-        if (HAS_THICKFRAME(dwStyle))
-        {
-            xinc += GetSystemMetrics(SM_CXFRAME);
-            yinc += GetSystemMetrics(SM_CYFRAME);
-        }
-        if (dwStyle & WS_BORDER)
-        {
-            xinc += GetSystemMetrics(SM_CXBORDER);
-            yinc += GetSystemMetrics(SM_CYBORDER);
-        }
+	xinc = yinc = 0;
+	if (HAS_THICKFRAME(dwStyle))
+	{
+	    xinc += GetSystemMetrics(SM_CXFRAME);
+	    yinc += GetSystemMetrics(SM_CYFRAME);
+	}
+	if (dwStyle & WS_BORDER)
+	{
+	    xinc += GetSystemMetrics(SM_CXBORDER);
+	    yinc += GetSystemMetrics(SM_CYBORDER);
+	}
     }
     MinMax.ptMaxSize.x += 2 * xinc;
@@ -622,10 +622,10 @@
     lpPos = (LPINTERNALPOS)GetPropA( hwndSelf, atomInternalPos );
     if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
-        CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
+	CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
     else
     {
 #endif
-        MinMax.ptMaxPosition.x = -xinc;
-        MinMax.ptMaxPosition.y = -yinc;
+	MinMax.ptMaxPosition.x = -xinc;
+	MinMax.ptMaxPosition.y = -yinc;
 //    }
 
@@ -635,12 +635,12 @@
 
     dprintf(("GetMinMaxInfo: %ld %ld / %ld %ld / %ld %ld / %ld %ld\n",
-                      MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
-                      MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
-                      MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
-                      MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y));
+		      MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
+		      MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
+		      MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
+		      MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y));
     MinMax.ptMaxTrackSize.x = MAX( MinMax.ptMaxTrackSize.x,
-                                   MinMax.ptMinTrackSize.x );
+				   MinMax.ptMinTrackSize.x );
     MinMax.ptMaxTrackSize.y = MAX( MinMax.ptMaxTrackSize.y,
-                                   MinMax.ptMinTrackSize.y );
+				   MinMax.ptMinTrackSize.y );
 
     if (maxSize)    *maxSize  = MinMax.ptMaxSize;
@@ -650,5 +650,5 @@
 }
 /***********************************************************************
- *           WINPOS_SendNCCalcSize
+ *	     WINPOS_SendNCCalcSize
  *
  * Send a WM_NCCALCSIZE message to a window.
@@ -658,6 +658,6 @@
  */
 LONG Win32Window::SendNCCalcSize(BOOL calcValidRect, RECT *newWindowRect, RECT *oldWindowRect,
-                                 RECT *oldClientRect, WINDOWPOS *winpos,
-                                 RECT *newClientRect )
+				 RECT *oldClientRect, WINDOWPOS *winpos,
+				 RECT *newClientRect )
 {
    NCCALCSIZE_PARAMS params;
@@ -668,11 +668,11 @@
    if (calcValidRect)
    {
-        winposCopy = *winpos;
-        params.rgrc[1] = *oldWindowRect;
-        params.rgrc[2] = *oldClientRect;
-        params.lppos = &winposCopy;
+	winposCopy = *winpos;
+	params.rgrc[1] = *oldWindowRect;
+	params.rgrc[2] = *oldClientRect;
+	params.lppos = &winposCopy;
    }
    result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
-                                 (LPARAM)&params );
+				 (LPARAM)&params );
    *newClientRect = params.rgrc[0];
    return result;
@@ -696,5 +696,5 @@
 {
   if(SendInternalMessageA(WM_CLOSE, 0, 0) == 0) {
-        return 0; //app handles this message
+	return 0; //app handles this message
   }
   delete this;
@@ -730,5 +730,5 @@
     dprintf(("MsgMove to (%d,%d)", x, y));
     if(fCreated == FALSE) {
-        return 1;
+	return 1;
     }
 
@@ -741,10 +741,10 @@
   switch(cmd) {
     case CMD_MENU:
-        return SendInternalMessageA(WM_COMMAND, MAKELONG(Id, 0), 0);
+	return SendInternalMessageA(WM_COMMAND, MAKELONG(Id, 0), 0);
     case CMD_CONTROL:
-        return 0; //todo
+	return 0; //todo
     case CMD_ACCELERATOR:
-        dprintf(("accelerator command"));
-        return 0; //todo
+	dprintf(("accelerator command"));
+	return 0; //todo
   }
   return 0;
@@ -765,13 +765,13 @@
 
     if(fCreated == FALSE) {//Solitaire crashes if it receives a WM_SIZE during CreateWindowEx (normal or our fault?)
-        return 1;
+	return 1;
     }
 
     if(fMinimize) {
-            fwSizeType = SIZE_MINIMIZED;
+	    fwSizeType = SIZE_MINIMIZED;
     }
     else
     if(fMaximize) {
-            fwSizeType = SIZE_MAXIMIZED;
+	    fwSizeType = SIZE_MAXIMIZED;
     }
     else    fwSizeType = SIZE_RESTORED;
@@ -785,7 +785,7 @@
     if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE)
     {
-        if(!fActivate) {
-            return 1;
-        }
+	if(!fActivate) {
+	    return 1;
+	}
     }
     return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);
@@ -807,16 +807,16 @@
     lParam |= (scancode << 16);
     if(keyflags & KEY_ALTDOWN)
-        lParam |= (1<<29);
+	lParam |= (1<<29);
     if(keyflags & KEY_PREVDOWN)
-        lParam |= (1<<30);
+	lParam |= (1<<30);
     if(keyflags & KEY_UP)
-        lParam |= (1<<31);
+	lParam |= (1<<31);
     if(keyflags & KEY_DEADKEY) {
-        dprintf(("WM_DEADCHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
-        return SendInternalMessageA(WM_DEADCHAR, cmd, lParam);
+	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);
+	dprintf(("WM_CHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
+	return SendInternalMessageA(WM_CHAR, cmd, lParam);
     }
 }
@@ -826,6 +826,6 @@
 {
     if(hwnd == 0) {
-        //other app lost focus
-        SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app
+	//other app lost focus
+	SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app
     }
     return SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
@@ -836,6 +836,6 @@
 {
     if(hwnd == 0) {
-        //other app lost focus
-        SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app
+	//other app lost focus
+	SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app
     }
     return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
@@ -850,48 +850,48 @@
     dprintf(("MsgButton to (%d,%d)", ncx, ncy));
     switch(msg) {
-        case BUTTON_LEFTDOWN:
-                win32msg = WM_LBUTTONDOWN;
-                win32ncmsg = WM_NCLBUTTONDOWN;
-                break;
-        case BUTTON_LEFTUP:
-                win32msg = WM_LBUTTONUP;
-                win32ncmsg = WM_NCLBUTTONUP;
-                break;
-        case BUTTON_LEFTDBLCLICK:
-                win32msg = WM_LBUTTONDBLCLK;
-                win32ncmsg = WM_NCLBUTTONDBLCLK;
-                break;
-        case BUTTON_RIGHTUP:
-                win32msg = WM_RBUTTONUP;
-                win32ncmsg = WM_NCRBUTTONUP;
-                break;
-        case BUTTON_RIGHTDOWN:
-                win32msg = WM_RBUTTONDOWN;
-                win32ncmsg = WM_NCRBUTTONDOWN;
-                break;
-        case BUTTON_RIGHTDBLCLICK:
-                win32msg = WM_RBUTTONDBLCLK;
-                win32ncmsg = WM_NCRBUTTONDBLCLK;
-                break;
-        case BUTTON_MIDDLEUP:
-                win32msg = WM_MBUTTONUP;
-                win32ncmsg = WM_NCMBUTTONUP;
-                break;
-        case BUTTON_MIDDLEDOWN:
-                win32msg = WM_MBUTTONDOWN;
-                win32ncmsg = WM_NCMBUTTONDOWN;
-                break;
-        case BUTTON_MIDDLEDBLCLICK:
-                win32msg = WM_MBUTTONDBLCLK;
-                win32ncmsg = WM_NCMBUTTONDBLCLK;
-                break;
-        default:
-                dprintf(("Win32Window::Button: invalid msg!!!!"));
-                return 1;
+	case BUTTON_LEFTDOWN:
+		win32msg = WM_LBUTTONDOWN;
+		win32ncmsg = WM_NCLBUTTONDOWN;
+		break;
+	case BUTTON_LEFTUP:
+		win32msg = WM_LBUTTONUP;
+		win32ncmsg = WM_NCLBUTTONUP;
+		break;
+	case BUTTON_LEFTDBLCLICK:
+		win32msg = WM_LBUTTONDBLCLK;
+		win32ncmsg = WM_NCLBUTTONDBLCLK;
+		break;
+	case BUTTON_RIGHTUP:
+		win32msg = WM_RBUTTONUP;
+		win32ncmsg = WM_NCRBUTTONUP;
+		break;
+	case BUTTON_RIGHTDOWN:
+		win32msg = WM_RBUTTONDOWN;
+		win32ncmsg = WM_NCRBUTTONDOWN;
+		break;
+	case BUTTON_RIGHTDBLCLICK:
+		win32msg = WM_RBUTTONDBLCLK;
+		win32ncmsg = WM_NCRBUTTONDBLCLK;
+		break;
+	case BUTTON_MIDDLEUP:
+		win32msg = WM_MBUTTONUP;
+		win32ncmsg = WM_NCMBUTTONUP;
+		break;
+	case BUTTON_MIDDLEDOWN:
+		win32msg = WM_MBUTTONDOWN;
+		win32ncmsg = WM_NCMBUTTONDOWN;
+		break;
+	case BUTTON_MIDDLEDBLCLICK:
+		win32msg = WM_MBUTTONDBLCLK;
+		win32ncmsg = WM_NCMBUTTONDBLCLK;
+		break;
+	default:
+		dprintf(("Win32Window::Button: invalid msg!!!!"));
+		return 1;
     }
     if(win32msg == WM_MBUTTONDBLCLK || win32msg == WM_RBUTTONDBLCLK || win32msg == WM_LBUTTONDBLCLK) {
-        if(!(windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)) {
-            return 1;
-        }
+	if(!(windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)) {
+	    return 1;
+	}
     }
     SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(ncx, ncy)); //TODO:
@@ -905,13 +905,13 @@
 
     if(keystate & WMMOVE_LBUTTON)
-        winstate |= MK_LBUTTON;
+	winstate |= MK_LBUTTON;
     if(keystate & WMMOVE_RBUTTON)
-        winstate |= MK_RBUTTON;
+	winstate |= MK_RBUTTON;
     if(keystate & WMMOVE_MBUTTON)
-        winstate |= MK_MBUTTON;
+	winstate |= MK_MBUTTON;
     if(keystate & WMMOVE_SHIFT)
-        winstate |= MK_SHIFT;
+	winstate |= MK_SHIFT;
     if(keystate & WMMOVE_CTRL)
-        winstate |= MK_CONTROL;
+	winstate |= MK_CONTROL;
 
     return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y));
@@ -925,10 +925,10 @@
 //******************************************************************************
 //TODO: Is the clipper region of the window DC equal to the invalidated rectangle?
-//      (or are we simply erasing too much here)
+//	(or are we simply erasing too much here)
 //******************************************************************************
 ULONG Win32Window::MsgEraseBackGround()
 {
     if(isIcon) {
-            return SendInternalMessageA(WM_ICONERASEBKGND, GetDC(getWindowHandle()), 0);
+	    return SendInternalMessageA(WM_ICONERASEBKGND, GetDC(getWindowHandle()), 0);
     }
     else    return SendInternalMessageA(WM_ERASEBKGND, GetDC(getWindowHandle()), 0);
@@ -939,5 +939,5 @@
 {
     if(isUnicode) {
-            return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
+	    return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
     }
     else    return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
@@ -955,8 +955,8 @@
 {
     if(isUnicode) {
-        SendInternalMessageW(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameW);
+	SendInternalMessageW(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameW);
     }
     else {
-        SendInternalMessageA(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameA);
+	SendInternalMessageA(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameA);
     }
     return windowNameA;
@@ -969,22 +969,22 @@
     {
     case WM_GETTEXTLENGTH:
-        return wndNameLength;
+	return wndNameLength;
 
     case WM_GETTEXT:   //TODO: SS_ICON controls
-        strncpy((LPSTR)lParam, windowNameA, wParam);
-        return min(wndNameLength, wParam);
+	strncpy((LPSTR)lParam, windowNameA, wParam);
+	return min(wndNameLength, wParam);
 
     case WM_SETTEXT:
-        return 0;
+	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
+	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);
+	return(TRUE);
 
     case WM_CTLCOLORMSGBOX:
@@ -995,41 +995,41 @@
     case WM_CTLCOLORSTATIC:
     case WM_CTLCOLORSCROLLBAR:
-         SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
-         SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
-         return GetSysColorBrush(COLOR_BTNFACE);
+	 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
+	 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
+	 return GetSysColorBrush(COLOR_BTNFACE);
 
     case WM_PARENTNOTIFY:
-        return 0;
+	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;
+	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;
+	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;
+	return 0;
 
     case WM_ERASEBKGND:
@@ -1040,10 +1040,10 @@
 	if (!windowClass->getBackgroundBrush()) return 0;
 
-        /*  Since WM_ERASEBKGND may receive either a window dc or a    */ 
-        /*  client dc, the area to be erased has to be retrieved from  */
-        /*  the device context.      				   */
-        GetClipBox( (HDC)wParam, &rect );
-
-        FillRect( (HDC)wParam, &rect, windowClass->getBackgroundBrush());
+	/*  Since WM_ERASEBKGND may receive either a window dc or a    */
+	/*  client dc, the area to be erased has to be retrieved from  */
+	/*  the device context. 				   */
+	GetClipBox( (HDC)wParam, &rect );
+
+	FillRect( (HDC)wParam, &rect, windowClass->getBackgroundBrush());
 
 	return 1;
@@ -1059,11 +1059,11 @@
     case WM_NCMBUTTONUP:
     case WM_NCMBUTTONDBLCLK:
-        return 0;           //TODO: Send WM_SYSCOMMAND if required
+	return 0;	    //TODO: Send WM_SYSCOMMAND if required
 
     case WM_NCHITTEST: //TODO:
-        return 0;
+	return 0;
 
     default:
-        return 1;
+	return 1;
     }
 }
@@ -1075,12 +1075,12 @@
     {
     case WM_GETTEXTLENGTH:
-        return wndNameLength;
+	return wndNameLength;
 
     case WM_GETTEXT:   //TODO: SS_ICON controls
-        lstrcpynW((LPWSTR)lParam, windowNameW, wParam);
-        return min(wndNameLength, wParam);
+	lstrcpynW((LPWSTR)lParam, windowNameW, wParam);
+	return min(wndNameLength, wParam);
 
     default:
-        return DefWindowProcA(Msg, wParam, lParam);
+	return DefWindowProcA(Msg, wParam, lParam);
     }
 }
@@ -1090,40 +1090,40 @@
 {
   if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
-        dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
+	dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
 
   if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
-        return(0);
+	return(0);
   }
   switch(Msg)
   {
-        case WM_CREATE:
-        {
-                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
-                        dprintf(("WM_NCCREATE returned FALSE\n"));
-                        return(-1); //don't create window
-                }
-                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == -1) {
-                        dprintf(("WM_CREATE returned -1\n"));
-                        return(-1); //don't create window
-                }
-                NotifyParent(Msg, wParam, lParam);
-
-                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:
-        case WM_RBUTTONDOWN:
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
-
-        case WM_DESTROY:
-                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
-        default:
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+	case WM_CREATE:
+	{
+		if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
+			dprintf(("WM_NCCREATE returned FALSE\n"));
+			return(-1); //don't create window
+		}
+		if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == -1) {
+			dprintf(("WM_CREATE returned -1\n"));
+			return(-1); //don't create window
+		}
+		NotifyParent(Msg, wParam, lParam);
+
+		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:
+	case WM_RBUTTONDOWN:
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+
+	case WM_DESTROY:
+		win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
+	default:
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
   }
 }
@@ -1133,41 +1133,41 @@
 {
   if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
-        dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
+	dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
 
   if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
-        return(0);
+	return(0);
   }
   switch(Msg)
   {
-        case WM_CREATE:
-        {
-                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
-                        dprintf(("WM_NCCREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
-                        dprintf(("WM_CREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                NotifyParent(Msg, wParam, lParam);
-
-                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:
-        case WM_RBUTTONDOWN:
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
-
-        case WM_DESTROY:
-                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
-
-        default:
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+	case WM_CREATE:
+	{
+		if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
+			dprintf(("WM_NCCREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
+			dprintf(("WM_CREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		NotifyParent(Msg, wParam, lParam);
+
+		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:
+	case WM_RBUTTONDOWN:
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+
+	case WM_DESTROY:
+		win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
+
+	default:
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
   }
 }
@@ -1178,37 +1178,37 @@
 {
   if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
-        dprintf(("SendInternalMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
+	dprintf(("SendInternalMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
 
   if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
-        return(0);
+	return(0);
   }
   switch(Msg)
   {
-        case WM_CREATE:
-        {
-                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
-                        dprintf(("WM_NCCREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
-                        dprintf(("WM_CREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                NotifyParent(Msg, wParam, lParam);
-
-                return(1);
-        }
-        case WM_LBUTTONDOWN:
-        case WM_MBUTTONDOWN:
-        case WM_RBUTTONDOWN:
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
-
-        case WM_DESTROY:
-                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
-        default:
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+	case WM_CREATE:
+	{
+		if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
+			dprintf(("WM_NCCREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
+			dprintf(("WM_CREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		NotifyParent(Msg, wParam, lParam);
+
+		return(1);
+	}
+	case WM_LBUTTONDOWN:
+	case WM_MBUTTONDOWN:
+	case WM_RBUTTONDOWN:
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+
+	case WM_DESTROY:
+		win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
+	default:
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
   }
 }
@@ -1220,37 +1220,37 @@
 {
   if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
-        dprintf(("SendInternalMessageW %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
+	dprintf(("SendInternalMessageW %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
 
   if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
-        return(0);
+	return(0);
   }
   switch(Msg)
   {
-        case WM_CREATE:
-        {
-                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
-                        dprintf(("WM_NCCREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
-                        dprintf(("WM_CREATE returned FALSE\n"));
-                        return(0); //don't create window
-                }
-                NotifyParent(Msg, wParam, lParam);
-
-                return(1);
-        }
-        case WM_LBUTTONDOWN:
-        case WM_MBUTTONDOWN:
-        case WM_RBUTTONDOWN:
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
-
-        case WM_DESTROY:
-                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
-                NotifyParent(Msg, wParam, lParam);
-                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
-        default:
-                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+	case WM_CREATE:
+	{
+		if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
+			dprintf(("WM_NCCREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
+			dprintf(("WM_CREATE returned FALSE\n"));
+			return(0); //don't create window
+		}
+		NotifyParent(Msg, wParam, lParam);
+
+		return(1);
+	}
+	case WM_LBUTTONDOWN:
+	case WM_MBUTTONDOWN:
+	case WM_RBUTTONDOWN:
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
+
+	case WM_DESTROY:
+		win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
+		NotifyParent(Msg, wParam, lParam);
+		return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
+	default:
+		return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
   }
 }
@@ -1266,5 +1266,5 @@
     return 0;
   }
-  postmsg->Msg    = msg;
+  postmsg->Msg	  = msg;
   postmsg->wParam = wParam;
   postmsg->lParam = lParam;
@@ -1282,5 +1282,5 @@
     return 0;
   }
-  postmsg->Msg    = msg;
+  postmsg->Msg	  = msg;
   postmsg->wParam = wParam;
   postmsg->lParam = lParam;
@@ -1297,18 +1297,18 @@
    while(window)
    {
-        if(window->getStyle() & WS_CHILD && !(window->getExStyle() & WS_EX_NOPARENTNOTIFY) )
-        {
-                /* Notify the parent window only */
-                parentwindow = window->getParent();
-                if(parentwindow) {
-                        if(Msg == WM_CREATE || Msg == WM_DESTROY) {
-                                parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
-                        }
-                        else    parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
-                }
-        }
-        else    break;
-
-        window = parentwindow;
+	if(window->getStyle() & WS_CHILD && !(window->getExStyle() & WS_EX_NOPARENTNOTIFY) )
+	{
+		/* Notify the parent window only */
+		parentwindow = window->getParent();
+		if(parentwindow) {
+			if(Msg == WM_CREATE || Msg == WM_DESTROY) {
+				parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
+			}
+			else	parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
+		}
+	}
+	else	break;
+
+	window = parentwindow;
    }
 }
@@ -1317,23 +1317,23 @@
 BOOL Win32Window::SetMenu(HMENU hMenu)
 {
- PVOID          menutemplate;
+ PVOID		menutemplate;
  Win32Resource *winres = (Win32Resource *)hMenu;
 
     dprintf(("SetMenu %x", hMenu));
     if(HIWORD(winres) == 0) {
-        dprintf(("Win32Window:: Win32Resource *winres == 0"));
-        SetLastError(ERROR_INVALID_PARAMETER);
-        return FALSE;
+	dprintf(("Win32Window:: Win32Resource *winres == 0"));
+	SetLastError(ERROR_INVALID_PARAMETER);
+	return FALSE;
     }
     menutemplate = winres->lockOS2Resource();
     if(menutemplate == NULL)
     {
-        dprintf(("Win32Window::SetMenu menutemplate == 0"));
-        return FALSE;
+	dprintf(("Win32Window::SetMenu menutemplate == 0"));
+	return FALSE;
     }
     OS2HwndMenu = OSLibWinCreateMenu(OS2HwndFrame, menutemplate);
     if(OS2HwndMenu == 0) {
-        dprintf(("Win32Window::SetMenu OS2HwndMenu == 0"));
-        return FALSE;
+	dprintf(("Win32Window::SetMenu OS2HwndMenu == 0"));
+	return FALSE;
     }
     menuResource = winres;
@@ -1345,10 +1345,10 @@
 {
  Win32Resource *winres = (Win32Resource *)hAccel;
- HANDLE         accelhandle;
+ HANDLE 	accelhandle;
 
     if(HIWORD(hAccel) == 0) {
-        dprintf(("SetAccelTable: hAccel %x invalid", hAccel));
-        SetLastError(ERROR_INVALID_PARAMETER);
-        return FALSE;
+	dprintf(("SetAccelTable: hAccel %x invalid", hAccel));
+	SetLastError(ERROR_INVALID_PARAMETER);
+	return FALSE;
     }
     acceltableResource = winres;
@@ -1372,12 +1372,12 @@
     dprintf(("ShowWindow %x", nCmdShow));
     if(fFirstShow) {
-        if(isFrameWindow() && IS_OVERLAPPED(getStyle())) {
-                SendMessageA(WM_SIZE, SIZE_RESTORED,
-                                MAKELONG(rectClient.right-rectClient.left,
-                                         rectClient.bottom-rectClient.top));
-                SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
-
-        }
-        fFirstShow = FALSE;
+	if(isFrameWindow() && IS_OVERLAPPED(getStyle())) {
+		SendMessageA(WM_SIZE, SIZE_RESTORED,
+				MAKELONG(rectClient.right-rectClient.left,
+					 rectClient.bottom-rectClient.top));
+		SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
+
+	}
+	fFirstShow = FALSE;
     }
     switch(nCmdShow)
@@ -1385,33 +1385,33 @@
     case SW_SHOW:
     case SW_SHOWDEFAULT: //todo
-        showstate = SWPOS_SHOW | SWPOS_ACTIVATE;
-        break;
+	showstate = SWPOS_SHOW | SWPOS_ACTIVATE;
+	break;
     case SW_HIDE:
-        showstate = SWPOS_HIDE;
-        break;
+	showstate = SWPOS_HIDE;
+	break;
     case SW_RESTORE:
-        showstate = SWPOS_RESTORE | SWPOS_SHOW | SWPOS_ACTIVATE;
-        break;
+	showstate = SWPOS_RESTORE | SWPOS_SHOW | SWPOS_ACTIVATE;
+	break;
     case SW_MINIMIZE:
-        showstate = SWPOS_MINIMIZE;
-        break;
+	showstate = SWPOS_MINIMIZE;
+	break;
     case SW_SHOWMAXIMIZED:
-        showstate = SWPOS_MAXIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE;
-        break;
+	showstate = SWPOS_MAXIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE;
+	break;
     case SW_SHOWMINIMIZED:
-        showstate = SWPOS_MINIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE;
-        break;
+	showstate = SWPOS_MINIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE;
+	break;
     case SW_SHOWMINNOACTIVE:
-        showstate = SWPOS_MINIMIZE | SWPOS_SHOW;
-        break;
+	showstate = SWPOS_MINIMIZE | SWPOS_SHOW;
+	break;
     case SW_SHOWNA:
-        showstate = SWPOS_SHOW;
-        break;
+	showstate = SWPOS_SHOW;
+	break;
     case SW_SHOWNOACTIVATE:
-        showstate = SWPOS_SHOW;
-        break;
+	showstate = SWPOS_SHOW;
+	break;
     case SW_SHOWNORMAL:
-        showstate = SWPOS_RESTORE | SWPOS_ACTIVATE | SWPOS_SHOW;
-        break;
+	showstate = SWPOS_RESTORE | SWPOS_ACTIVATE | SWPOS_SHOW;
+	break;
     }
     return OSLibWinShowWindow(OS2HwndFrame, showstate);
@@ -1422,84 +1422,86 @@
 {
  Win32Window *window;
- ULONG        setstate = 0;
+ ULONG	      setstate = 0;
 
     switch(hwndInsertAfter) {
     case HWND_BOTTOM:
-        hwndInsertAfter = HWNDOS_BOTTOM;
-        break;
+	hwndInsertAfter = HWNDOS_BOTTOM;
+	break;
     case HWND_TOPMOST: //TODO
     case HWND_NOTOPMOST: //TODO:
     case HWND_TOP:
-        hwndInsertAfter = HWNDOS_TOP;
-        break;
+	hwndInsertAfter = HWNDOS_TOP;
+	break;
     default:
-        window = GetWindowFromHandle(hwndInsertAfter);
-        if(window) {
-            hwndInsertAfter = window->getOS2WindowHandle();
-            PRECT clientRect = window->getClientRect();
+	window = GetWindowFromHandle(hwndInsertAfter);
+	if(window) {
+	    hwndInsertAfter = window->getOS2WindowHandle();
+	    PRECT clientRect = window->getClientRect();
 
 #if 1
-            if(x+cx > clientRect->right - clientRect->left) {
-                dprintf(("Adjusting cx from %d to %d", cx, (clientRect->right - clientRect->left) - x));
-                cx = (clientRect->right - clientRect->left) - x;
-            }
-            if(y+cy > clientRect->bottom - clientRect->top) {
-                dprintf(("Adjusting cy from %d to %d", cy, (clientRect->bottom - clientRect->top) - y));
-                cy = (clientRect->bottom - clientRect->top) - y;
-            }
+	    if(x+cx > clientRect->right - clientRect->left) {
+		dprintf(("Adjusting cx from %d to %d", cx, (clientRect->right - clientRect->left) - x));
+		cx = (clientRect->right - clientRect->left) - x;
+	    }
+	    if(y+cy > clientRect->bottom - clientRect->top) {
+		dprintf(("Adjusting cy from %d to %d", cy, (clientRect->bottom - clientRect->top) - y));
+		cy = (clientRect->bottom - clientRect->top) - y;
+	    }
 #endif
-            //Correct coordinates if parent is a frame window (border adjustment)
-            //TODO: Not quite right (Solitaire child window placement slightly wrong)
-            if (window->isFrameWindow() && !(fuFlags & SWP_NOMOVE)) {
-                if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() ))
-                {
-                    x += GetSystemMetrics(SM_CXDLGFRAME);
-                    y -= GetSystemMetrics(SM_CYDLGFRAME);
-                }
-                else
-                {
-                    if (HAS_THICKFRAME(window->getStyle()))
-                    {
-                        x += GetSystemMetrics(SM_CXFRAME);
-                        y -= GetSystemMetrics(SM_CYFRAME);
-                    }
-                    else
-                    if (window->getStyle() & WS_BORDER)
-                    {
-                        x += GetSystemMetrics(SM_CXBORDER);
-                        y -= GetSystemMetrics(SM_CYBORDER);
-                    }
-                }
-            }
-        }
-        else {
-            dprintf(("Win32Window::SetWindowPos, unknown hwndInsertAfter %x", hwndInsertAfter));
-            hwndInsertAfter = 0;
-        }
-
-        break;
+#if 0
+	    //Correct coordinates if parent is a frame window (border adjustment)
+	    //TODO: Not quite right (Solitaire child window placement slightly wrong)
+	    if (window->isFrameWindow() && !(fuFlags & SWP_NOMOVE)) {
+		if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() ))
+		{
+		    x += GetSystemMetrics(SM_CXDLGFRAME);
+		    y -= GetSystemMetrics(SM_CYDLGFRAME);
+		}
+		else
+		{
+		    if (HAS_THICKFRAME(window->getStyle()))
+		    {
+			x += GetSystemMetrics(SM_CXFRAME);
+			y -= GetSystemMetrics(SM_CYFRAME);
+		    }
+		    else
+		    if (window->getStyle() & WS_BORDER)
+		    {
+			x += GetSystemMetrics(SM_CXBORDER);
+			y -= GetSystemMetrics(SM_CYBORDER);
+		    }
+		}
+	    }
+#endif
+	}
+	else {
+	    dprintf(("Win32Window::SetWindowPos, unknown hwndInsertAfter %x", hwndInsertAfter));
+	    hwndInsertAfter = 0;
+	}
+
+	break;
 
     }
     setstate = SWPOS_MOVE | SWPOS_SIZE | SWPOS_ACTIVATE | SWPOS_ZORDER;
     if(fuFlags & SWP_DRAWFRAME)
-        setstate |= 0; //TODO
+	setstate |= 0; //TODO
     if(fuFlags & SWP_FRAMECHANGED)
-        setstate |= 0; //TODO
+	setstate |= 0; //TODO
     if(fuFlags & SWP_HIDEWINDOW)
-        setstate &= ~SWPOS_ZORDER;
+	setstate &= ~SWPOS_ZORDER;
     if(fuFlags & SWP_NOACTIVATE)
-        setstate &= ~SWPOS_ACTIVATE;
+	setstate &= ~SWPOS_ACTIVATE;
     if(fuFlags & SWP_NOCOPYBITS)
-        setstate |= 0;      //TODO
+	setstate |= 0;	    //TODO
     if(fuFlags & SWP_NOMOVE)
-        setstate &= ~SWPOS_MOVE;
+	setstate &= ~SWPOS_MOVE;
     if(fuFlags & SWP_NOSIZE)
-        setstate &= ~SWPOS_SIZE;
+	setstate &= ~SWPOS_SIZE;
     if(fuFlags & SWP_NOREDRAW)
-        setstate |= SWPOS_NOREDRAW;
+	setstate |= SWPOS_NOREDRAW;
     if(fuFlags & SWP_NOZORDER)
-        setstate &= ~SWPOS_ZORDER;
+	setstate &= ~SWPOS_ZORDER;
     if(fuFlags & SWP_SHOWWINDOW)
-        setstate |= SWPOS_SHOW;
+	setstate |= SWPOS_SHOW;
 
     //TODO send NCCREATE if size changed or SWP_FRAMECHANGED flag specified.
@@ -1520,5 +1522,5 @@
     return getParent()->getWindowHandle();
   }
-  else  return 0;
+  else	return 0;
 }
 //******************************************************************************
@@ -1530,5 +1532,5 @@
 
    if(getParent()) {
-        oldhwnd = getParent()->getWindowHandle();
+	oldhwnd = getParent()->getWindowHandle();
    }
    else oldhwnd = 0;
@@ -1536,13 +1538,13 @@
    if(hwndNewParent == 0) {//desktop window = parent
     setParent(NULL);
-        OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP);
-        return oldhwnd;
+	OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP);
+	return oldhwnd;
    }
    newparent = GetWindowFromHandle(hwndNewParent);
    if(newparent)
    {
-        setParent(newparent);
-        OSLibWinSetParent(getOS2WindowHandle(), getParent()->getOS2WindowHandle());
-        return oldhwnd;
+	setParent(newparent);
+	OSLibWinSetParent(getOS2WindowHandle(), getParent()->getOS2WindowHandle());
+	return oldhwnd;
    }
    SetLastError(ERROR_INVALID_PARAMETER);
@@ -1556,5 +1558,5 @@
     return getParent()->getWindowHandle() == hwndParent;
   }
-  else  return 0;
+  else	return 0;
 }
 //******************************************************************************
@@ -1575,5 +1577,5 @@
     if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect))
     {//update region not empty
-        SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);
+	SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);
     }
     return TRUE;
@@ -1591,47 +1593,47 @@
 {
  Win32Window  *win32wnd;
- ULONG         magic;
- ULONG         getcmd = 0;
- HWND          hwndRelated;
+ 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;
+	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(OS2Hwnd, getcmd);
     if(hwndRelated)
     {
-        win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
-        magic    = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
-        if(CheckMagicDword(magic) && win32wnd)
-        {
-            return win32wnd->getWindowHandle();
-        }
+	win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
+	magic	 = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
+	if(CheckMagicDword(magic) && win32wnd)
+	{
+	    return win32wnd->getWindowHandle();
+	}
     }
     return 0;
@@ -1660,7 +1662,7 @@
 HWND Win32Window::GetActiveWindow()
 {
- HWND          hwndActive;
+ HWND	       hwndActive;
  Win32Window  *win32wnd;
- ULONG         magic;
+ ULONG	       magic;
 
   hwndActive = OSLibWinQueryActiveWindow();
@@ -1723,40 +1725,40 @@
 
    switch(index) {
-        case GWL_EXSTYLE:
-                oldval = dwExStyle;
-                dwExStyle = value;
-                return oldval;
-        case GWL_STYLE:
-                oldval = dwStyle;
-                dwStyle = value;
-                return oldval;
-        case GWL_WNDPROC:
-                oldval = (LONG)getWindowProc();
-                setWindowProc((WNDPROC)value);
-                return oldval;
-        case GWL_HINSTANCE:
-                oldval = hInstance;
-                hInstance = value;
-                return oldval;
-        case GWL_HWNDPARENT:
-        return SetParent((HWND)value);
-
-        case GWL_ID:
-                oldval = getWindowId();
-                setWindowId(value);
-                return oldval;
-        case GWL_USERDATA:
-                oldval = userData;
-                userData = value;
-                return oldval;
-        default:
-                if(index >= 0 && index/4 < nrUserWindowLong)
-                {
-                        oldval = userWindowLong[index/4];
-                        userWindowLong[index/4] = value;
-                        return oldval;
-                }
-                SetLastError(ERROR_INVALID_PARAMETER);
-                return 0;
+	case GWL_EXSTYLE:
+		oldval = dwExStyle;
+		dwExStyle = value;
+		return oldval;
+	case GWL_STYLE:
+		oldval = dwStyle;
+		dwStyle = value;
+		return oldval;
+	case GWL_WNDPROC:
+		oldval = (LONG)getWindowProc();
+		setWindowProc((WNDPROC)value);
+		return oldval;
+	case GWL_HINSTANCE:
+		oldval = hInstance;
+		hInstance = value;
+		return oldval;
+	case GWL_HWNDPARENT:
+	return SetParent((HWND)value);
+
+	case GWL_ID:
+		oldval = getWindowId();
+		setWindowId(value);
+		return oldval;
+	case GWL_USERDATA:
+		oldval = userData;
+		userData = value;
+		return oldval;
+	default:
+		if(index >= 0 && index/4 < nrUserWindowLong)
+		{
+			oldval = userWindowLong[index/4];
+			userWindowLong[index/4] = value;
+			return oldval;
+		}
+		SetLastError(ERROR_INVALID_PARAMETER);
+		return 0;
    }
 }
@@ -1766,28 +1768,28 @@
 {
    switch(index) {
-        case GWL_EXSTYLE:
-                return dwExStyle;
-        case GWL_STYLE:
-                return dwStyle;
-        case GWL_WNDPROC:
-                return (ULONG)getWindowProc();
-        case GWL_HINSTANCE:
-                return hInstance;
-        case GWL_HWNDPARENT:
-                if(getParent()) {
-                        return getParent()->getWindowHandle();
-                }
-                else    return 0;
-        case GWL_ID:
-                return getWindowId();
-        case GWL_USERDATA:
-                return userData;
-        default:
-                if(index >= 0 && index/4 < nrUserWindowLong)
-                {
-                        return userWindowLong[index/4];
-                }
-                SetLastError(ERROR_INVALID_PARAMETER);
-                return 0;
+	case GWL_EXSTYLE:
+		return dwExStyle;
+	case GWL_STYLE:
+		return dwStyle;
+	case GWL_WNDPROC:
+		return (ULONG)getWindowProc();
+	case GWL_HINSTANCE:
+		return hInstance;
+	case GWL_HWNDPARENT:
+		if(getParent()) {
+			return getParent()->getWindowHandle();
+		}
+		else	return 0;
+	case GWL_ID:
+		return getWindowId();
+	case GWL_USERDATA:
+		return userData;
+	default:
+		if(index >= 0 && index/4 < nrUserWindowLong)
+		{
+			return userWindowLong[index/4];
+		}
+		SetLastError(ERROR_INVALID_PARAMETER);
+		return 0;
    }
 }
@@ -1800,7 +1802,7 @@
    if(index >= 0 && index/4 < nrUserWindowLong)
    {
-        oldval = ((WORD *)userWindowLong)[index/2];
-        ((WORD *)userWindowLong)[index/2] = value;
-        return oldval;
+	oldval = ((WORD *)userWindowLong)[index/2];
+	((WORD *)userWindowLong)[index/2] = value;
+	return oldval;
    }
    SetLastError(ERROR_INVALID_PARAMETER);
@@ -1813,5 +1815,5 @@
    if(index >= 0 && index/4 < nrUserWindowLong)
    {
-        return ((WORD *)userWindowLong)[index/2];
+	return ((WORD *)userWindowLong)[index/2];
    }
    SetLastError(ERROR_INVALID_PARAMETER);
@@ -1838,5 +1840,5 @@
 {
  Win32Window *win32wnd;
- DWORD        magic;
+ DWORD	      magic;
 
   win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
