Commit in reactos/lib/user32/windows on MAIN
menu.c+7-41.50 -> 1.51
Fix key left at begin and key right at end of menu

reactos/lib/user32/windows
menu.c 1.50 -> 1.51
diff -u -r1.50 -r1.51
--- menu.c	22 Feb 2004 23:40:58 -0000	1.50
+++ menu.c	23 Feb 2004 20:10:01 -0000	1.51
@@ -21,7 +21,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: menu.c,v 1.50 2004/02/22 23:40:58 gvg Exp $
+/* $Id: menu.c,v 1.51 2004/02/23 20:10:01 gvg Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/menu.c
@@ -238,6 +238,7 @@
           ItemInfo->cch = 0;
         }
       ItemInfo->fType = 0;
+      return FALSE;
     }
 
   if (MF_STRING == MENU_ITEM_TYPE(ItemInfo->fType))
@@ -2241,7 +2242,7 @@
           Index = NtUserMenuItemFromPoint(Mt->OwnerWnd, PtMenu, Mt->Pt.x, Mt->Pt.y);
         }
       MenuInitRosMenuItemInfo(&Item);
-      if (Index < 0 || ! MenuGetRosMenuItemInfo(PtMenu, Index, &Item))
+      if (NO_SELECTED_ITEM == Index || ! MenuGetRosMenuItemInfo(PtMenu, Index, &Item))
         {
           MenuCleanupRosMenuItemInfo(&Item);
           return FALSE;
@@ -2809,7 +2810,8 @@
           /* A sublevel menu was displayed - display the next one
            * unless there is another displacement coming up */
 
-          if (! MenuSuspendPopup(Mt, WM_KEYDOWN))
+          if (! MenuSuspendPopup(Mt, WM_KEYDOWN)
+              && MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu))
             {
               Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &TopMenuInfo,
                                                  TRUE, Flags);
@@ -2891,7 +2893,8 @@
 
       if (NULL != MenuTmp || 0 != (Mt->TrackFlags & TF_SUSPENDPOPUP))
         {
-          if (! MenuSuspendPopup(Mt, WM_KEYDOWN))
+          if (! MenuSuspendPopup(Mt, WM_KEYDOWN)
+              && MenuGetRosMenuInfo(&MenuInfo, Mt->TopMenu))
             {
               Mt->CurrentMenu = MenuShowSubPopup(Mt->OwnerWnd, &MenuInfo,
                                                  TRUE, Flags);
CVSspam 0.2.8