Index: trunk/src/user32/msgbox.cpp
===================================================================
--- trunk/src/user32/msgbox.cpp	(revision 1239)
+++ trunk/src/user32/msgbox.cpp	(revision 1240)
@@ -1,3 +1,3 @@
-/* $Id: msgbox.cpp,v 1.3 1999-10-01 10:15:23 sandervl Exp $ */
+/* $Id: msgbox.cpp,v 1.4 1999-10-10 08:59:40 sandervl Exp $ */
 /*
  * Win32 message box function for OS/2
@@ -149,5 +149,5 @@
 //******************************************************************************
 //******************************************************************************
-int WIN32API MessageBoxW(HWND arg1, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
+int WIN32API MessageBoxW(HWND hwndOwner, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
 {
  char *astring1, *astring2;
@@ -159,5 +159,6 @@
     WriteLog("USER32:  MessageBoxW %s %s\n", astring1, astring2);
 #endif
-    rc = O32_MessageBox(arg1, astring1, astring2, arg4);
+    hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
+    rc = O32_MessageBox(hwndOwner, astring1, astring2, arg4);
     FreeAsciiString(astring1);
     FreeAsciiString(astring2);
Index: trunk/src/user32/oslibwin.cpp
===================================================================
--- trunk/src/user32/oslibwin.cpp	(revision 1239)
+++ trunk/src/user32/oslibwin.cpp	(revision 1240)
@@ -1,3 +1,3 @@
-/* $Id: oslibwin.cpp,v 1.18 1999-10-08 21:25:26 cbratschi Exp $ */
+/* $Id: oslibwin.cpp,v 1.19 1999-10-10 08:59:40 sandervl Exp $ */
 /*
  * Window API wrappers for OS/2
@@ -120,8 +120,11 @@
   if (dwStyle & WS_CHILD_W)
   {
+//SvL: Causes crash in VPBuddy if enabled
+#if 0
     if (dwStyle & WS_BORDER_W ||
         dwStyle & WS_DLGFRAME_W ||
         dwStyle & WS_THICKFRAME_W)
-          if (!HAS_3DFRAME(*OSFrameStyle)) *OSFrameStyle |= WS_EX_WINDOWEDGE_W;
+          if (!HAS_3DFRAME(dwExStyle)) dwExStyle |= WS_EX_WINDOWEDGE_W;
+#endif
 
     if (dwExStyle & WS_EX_CLIENTEDGE_W ||
@@ -132,10 +135,10 @@
             *borderHeight = *borderWidth = 2; //CB: right?
           }
-
     if(dwStyle & WS_VSCROLL_W)
           *OSFrameStyle |= FCF_VERTSCROLL;
     if(dwStyle & WS_HSCROLL_W)
           *OSFrameStyle |= FCF_HORZSCROLL;
-  } else
+  } 
+  else
   {
     if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W)
Index: trunk/src/user32/win32dlg.cpp
===================================================================
--- trunk/src/user32/win32dlg.cpp	(revision 1239)
+++ trunk/src/user32/win32dlg.cpp	(revision 1240)
@@ -1,3 +1,3 @@
-/* $Id: win32dlg.cpp,v 1.8 1999-10-08 18:39:34 sandervl Exp $ */
+/* $Id: win32dlg.cpp,v 1.9 1999-10-10 08:59:41 sandervl Exp $ */
 /*
  * Win32 Dialog Code for OS/2
@@ -199,5 +199,5 @@
         hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
 
-	if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
+    if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
              SetFocus(hwndFocus);
 
@@ -207,5 +207,5 @@
             ::UpdateWindow( getWindowHandle() );
         }
-	SetLastError(0);
+    SetLastError(0);
         dprintf(("********* DIALOG CREATED ************"));
         return;
@@ -233,5 +233,5 @@
     /* Owner must be a top-level window */
     if(getOwner() == NULL) {
-	 topOwner = windowDesktop;
+     topOwner = windowDesktop;
     }
     else topOwner = getOwner()->getTopParent();
@@ -980,14 +980,91 @@
         if (child == nextchild) break;
 
-	    if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
+        if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
             !(nextchild->getStyle() & WS_DISABLED))
+        {
+            lastchild = nextchild;
+            if (!fPrevious) break;
+        }
+        nextchild = (Win32BaseWindow *)nextchild->getNextChild();
+    }
+    retvalue = lastchild->getWindowHandle();
+
+END:
+    return retvalue;
+}
+//******************************************************************************
+//******************************************************************************
+HWND Win32Dialog::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
+{
+ Win32BaseWindow *child, *nextchild, *lastchild;
+ HWND retvalue;
+
+    if (hwndCtrl)
+    {
+        child = GetWindowFromHandle(hwndCtrl);
+        if (!child)
+        {
+            retvalue = 0;
+            goto END;
+        }
+        /* Make sure hwndCtrl is a top-level child */
+        while ((child->getStyle() & WS_CHILD) && (child->getParent() != this))
+        {
+            child = child->getParent();
+            if(child == NULL) break;
+        }
+
+        if (!child || child->getParent() != this)
+        {
+            retvalue = 0;
+            goto END;
+        }
+    }
+    else
+    {
+        /* No ctrl specified -> start from the beginning */
+        child = (Win32BaseWindow *)getFirstChild();
+        if (!child)
+        {
+            retvalue = 0;
+            goto END;
+        }
+
+        if (fPrevious)
+        {
+            while (child->getNextChild())
+            {
+                child = (Win32BaseWindow *)child->getNextChild();
+            }
+        }
+    }
+
+    lastchild = child;
+    nextchild = (Win32BaseWindow *)child->getNextChild();
+    while (TRUE)
+    {
+        if (!nextchild || nextchild->getStyle() & WS_GROUP)
+        {
+            /* Wrap-around to the beginning of the group */
+            Win32BaseWindow *pWndTemp;
+
+            nextchild = (Win32BaseWindow *)getFirstChild();
+
+            for(pWndTemp = nextchild;pWndTemp;pWndTemp = (Win32BaseWindow *)pWndTemp->getNextChild())
+            {
+                if (pWndTemp->getStyle() & WS_GROUP) nextchild = pWndTemp;
+                if (pWndTemp == child) break;
+            }
+
+        }
+        if (nextchild == child) break;
+
+	    if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
 	    {
 	        lastchild = nextchild;
-	        if (!fPrevious) break;
-	    }
-	    nextchild = (Win32BaseWindow *)nextchild->getNextChild();
+    	    if (!fPrevious) break;
+    	}
     }
     retvalue = lastchild->getWindowHandle();
-
 END:
     return retvalue;
Index: trunk/src/user32/win32dlg.h
===================================================================
--- trunk/src/user32/win32dlg.h	(revision 1239)
+++ trunk/src/user32/win32dlg.h	(revision 1240)
@@ -1,3 +1,3 @@
-/* $Id: win32dlg.h,v 1.1 1999-09-15 23:19:00 sandervl Exp $ */
+/* $Id: win32dlg.h,v 1.2 1999-10-10 08:59:41 sandervl Exp $ */
 /*
  * Win32 Dialog Code for OS/2
@@ -70,4 +70,5 @@
 
          HWND   getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious);
+         HWND   getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious);
          BOOL   endDialog(int retval);
 
Index: trunk/src/user32/windlg.cpp
===================================================================
--- trunk/src/user32/windlg.cpp	(revision 1239)
+++ trunk/src/user32/windlg.cpp	(revision 1240)
@@ -1,3 +1,3 @@
-/* $Id: windlg.cpp,v 1.3 1999-10-04 09:56:03 sandervl Exp $ */
+/* $Id: windlg.cpp,v 1.4 1999-10-10 08:59:41 sandervl Exp $ */
 /*
  * Win32 dialog apis for OS/2
@@ -19,4 +19,6 @@
 #include <string.h>
 #include <stdlib.h>
+#include <limits.h>
+#include <errno.h>
 #include "win32wbase.h"
 #include "win32dlg.h"
@@ -316,19 +318,48 @@
 //******************************************************************************
 //******************************************************************************
-UINT WIN32API GetDlgItemInt( HWND arg1, int arg2, PBOOL arg3, BOOL  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  GetDlgItemInt\n");
-#endif
-    return O32_GetDlgItemInt(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-HWND WIN32API GetNextDlgGroupItem( HWND arg1, HWND arg2, BOOL  arg3)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  GetNextDlgGroupItem\n");
-#endif
-    return O32_GetNextDlgGroupItem(arg1, arg2, arg3);
+UINT WIN32API GetDlgItemInt(HWND hwnd, INT id, BOOL *translated, BOOL fSigned)
+{
+  char str[30];
+  char * endptr;
+  long result = 0;
+
+    dprintf(("USER32:  GetDlgItemInt\n"));
+    if (translated) *translated = FALSE;
+
+    if (!SendDlgItemMessageA(hwnd, id, WM_GETTEXT, sizeof(str), (LPARAM)str))
+        return 0;
+
+    if (fSigned)
+    {
+        result = strtol( str, &endptr, 10 );
+        if (!endptr || (endptr == str))  /* Conversion was unsuccessful */
+            return 0;
+        if (((result == LONG_MIN) || (result == LONG_MAX)) && (errno==ERANGE))
+            return 0;
+    }
+    else
+    {
+        result = strtoul( str, &endptr, 10 );
+        if (!endptr || (endptr == str))  /* Conversion was unsuccessful */
+            return 0;
+        if ((result == ULONG_MAX) && (errno == ERANGE)) return 0;
+    }
+    if (translated) *translated = TRUE;
+    return (UINT)result;
+}
+//******************************************************************************
+//******************************************************************************
+HWND WIN32API GetNextDlgGroupItem( HWND hwnd, HWND hwndCtrl, BOOL fPrevious)
+{
+  Win32Dialog *dialog;
+
+    dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
+    if(!dialog || !dialog->IsDialog()) {
+        dprintf(("GetNextDlgGroupItem, window %x not found", hwnd));
+	SetLastError(ERROR_INVALID_WINDOW_HANDLE);
+        return 0;
+    }
+    dprintf(("USER32:  GetNextDlgGroupItem\n"));
+    return dialog->getNextDlgGroupItem(hwndCtrl, fPrevious);
 }
 /***********************************************************************
