Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 7091)
+++ trunk/src/user32/win32wbase.cpp	(revision 7095)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.290 2001-10-17 13:26:57 phaller Exp $ */
+/* $Id: win32wbase.cpp,v 1.291 2001-10-17 14:30:09 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -3299,4 +3299,5 @@
         break;
 
+    //for internal use only
     case GW_HWNDNEXTCHILD:
         lock();
@@ -3307,4 +3308,8 @@
         else hwndRelated = 0;
         unlock();
+        break;
+
+    case GW_HWNDPREVCHILD:
+        DebugInt3();
         break;
 
Index: trunk/src/user32/win32wbase.h
===================================================================
--- trunk/src/user32/win32wbase.h	(revision 7091)
+++ trunk/src/user32/win32wbase.h	(revision 7095)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.130 2001-10-09 05:18:04 phaller Exp $ */
+/* $Id: win32wbase.h,v 1.131 2001-10-17 14:30:10 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -38,4 +38,5 @@
 
 #define GW_HWNDNEXTCHILD          (0x10000 | GW_HWNDNEXT)
+#define GW_HWNDPREVCHILD          (0x10000 | GW_HWNDPREV)
 #define GW_HWNDFIRSTCHILD         (0x10000 | GW_CHILD)
 #define GW_HWNDLASTCHILD          (0x10000 | GW_HWNDLAST)
Index: trunk/src/user32/windlg.cpp
===================================================================
--- trunk/src/user32/windlg.cpp	(revision 7091)
+++ trunk/src/user32/windlg.cpp	(revision 7095)
@@ -1,3 +1,3 @@
-/* $Id: windlg.cpp,v 1.26 2001-10-13 00:49:28 sandervl Exp $ */
+/* $Id: windlg.cpp,v 1.27 2001-10-17 14:30:10 sandervl Exp $ */
 /*
  * Win32 dialog apis for OS/2
@@ -552,17 +552,9 @@
         /* No ctrl specified -> start from the beginning */
         if (!(hwndCtrl = GetWindow( hwndDlg, GW_CHILD ))) return 0;
-#ifdef __WIN32OS2__
-        if (fPrevious) hwndCtrl = GetWindow( hwndCtrl, GW_HWNDLASTCHILD );
-#else
         if (fPrevious) hwndCtrl = GetWindow( hwndCtrl, GW_HWNDLAST );
-#endif
     }
 
     retvalue = hwndCtrl;
-#ifdef __WIN32OS2__
-    hwnd = GetWindow( hwndCtrl, GW_HWNDNEXTCHILD );
-#else
     hwnd = GetWindow( hwndCtrl, GW_HWNDNEXT );
-#endif
     while (1)
     {
@@ -572,13 +564,9 @@
             HWND tmp;
 
+            hwnd = GetWindow( hwndDlg, GW_CHILD );
 #ifdef __WIN32OS2__
-            hwnd = GetWindow( hwndDlg, GW_HWNDFIRSTCHILD );
             if(!hwnd) break;
-
-            for (tmp = hwnd; tmp; tmp = GetWindow( tmp, GW_HWNDNEXTCHILD ) )
-#else
-            hwnd = GetWindow( hwndDlg, GW_CHILD );
+#endif
             for (tmp = hwnd; tmp; tmp = GetWindow( tmp, GW_HWNDNEXT ) )
-#endif
             {
                 if (GetWindowLongW( tmp, GWL_STYLE ) & WS_GROUP) hwnd = tmp;
@@ -592,9 +580,5 @@
 	    if (!fPrevious) break;
 	}
-#ifdef __WIN32OS2__
-        hwnd = GetWindow( hwnd, GW_HWNDNEXTCHILD );
-#else
         hwnd = GetWindow( hwnd, GW_HWNDNEXT );
-#endif
     }
     return retvalue;
Index: trunk/src/user32/window.cpp
===================================================================
--- trunk/src/user32/window.cpp	(revision 7091)
+++ trunk/src/user32/window.cpp	(revision 7095)
@@ -1,3 +1,3 @@
-/* $Id: window.cpp,v 1.109 2001-10-10 14:39:58 sandervl Exp $ */
+/* $Id: window.cpp,v 1.110 2001-10-17 14:30:10 sandervl Exp $ */
 /*
  * Win32 window apis for OS/2
@@ -806,11 +806,8 @@
     }
     teb->o.odin.hwndFocus = 0;
-////    if(activate) {
-////        SetActiveWindow(hwndTopParent);
-////    }
     if(!IsWindow(hwnd)) return FALSE;       //abort if window destroyed
 
-    //Always activate window (3rd par) -> seems to fix activation problems
-    return (OSLibWinSetFocus(OSLIB_HWND_DESKTOP, hwnd_O, 1)) ? lastFocus_W : 0;
+    //NOTE: Don't always activate the window or else the z-order will be changed!!
+    return (OSLibWinSetFocus(OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
 }
 //******************************************************************************
