Fixed keystroke accelerators in dialogs which have controls containing
other controls as child windows.

diff --git a/windows/dialog.c b/windows/dialog.c
index c4f763d..a552636 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -1010,6 +1010,7 @@
 static BOOL32 DIALOG_IsAccelerator( HWND32 hwnd, HWND32 hwndDlg, WPARAM32 vKey )
 {
     HWND32 hwndControl = hwnd;
+    HWND32 hwndNext;
     WND *wndPtr;
     BOOL32 RetVal = FALSE;
     INT32 dlgCode;
@@ -1075,11 +1076,24 @@
                     }
                 }
             }
-            hwndControl = GetWindow32( hwndControl, GW_HWNDNEXT );
-            if (!hwndControl)
-            {
-                hwndControl = GetWindow32( hwndDlg, GW_CHILD );
-            }
+	    hwndNext = GetWindow32( hwndControl, GW_CHILD );
+	    if (!hwndNext)
+	    {
+	        hwndNext = GetWindow32( hwndControl, GW_HWNDNEXT );
+	    }
+	    while (!hwndNext)
+	    {
+		hwndControl = GetParent32( hwndControl );
+		if (hwndControl == hwndDlg)
+		{
+		    hwndNext = GetWindow32( hwndDlg, GW_CHILD );
+		}
+		else
+		{
+		    hwndNext = GetWindow32( hwndControl, GW_HWNDNEXT );
+		}
+	    }
+            hwndControl = hwndNext;
         }
         while (hwndControl != hwnd);
     }