Commit in reactos/subsys/win32k/ntuser on MAIN
menu.c+19-21.48 -> 1.49
Recursively search sub menus when a command id is specified

reactos/subsys/win32k/ntuser
menu.c 1.48 -> 1.49
diff -u -r1.48 -r1.49
--- menu.c	22 Feb 2004 23:40:58 -0000	1.48
+++ menu.c	23 Feb 2004 21:18:45 -0000	1.49
@@ -16,7 +16,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.48 2004/02/22 23:40:58 gvg Exp $
+/* $Id: menu.c,v 1.49 2004/02/23 21:18:45 gvg Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -507,11 +507,13 @@
 
 int FASTCALL
 IntGetMenuItemByFlag(PMENU_OBJECT MenuObject, UINT uSearchBy, UINT fFlag, 
-                      PMENU_ITEM *MenuItem, PMENU_ITEM *PrevMenuItem)
+                     PMENU_ITEM *MenuItem, PMENU_ITEM *PrevMenuItem)
 {
   PMENU_ITEM PrevItem = NULL;
   PMENU_ITEM CurItem = MenuObject->MenuItemList;
   int p;
+  int ret;
+
   if(MF_BYPOSITION & fFlag)
   {
     p = uSearchBy;
@@ -546,6 +548,21 @@
         if(PrevMenuItem) *PrevMenuItem = PrevItem;
         return p;
       }
+      else if (0 != (CurItem->fType & MF_POPUP))
+      {
+        MenuObject = IntGetMenuObject(CurItem->hSubMenu);
+        if (NULL != MenuObject)
+        {
+          ret = IntGetMenuItemByFlag(MenuObject, uSearchBy, fFlag,
+                                     MenuItem, PrevMenuItem);
+          if (-1 != ret)
+          {
+            IntReleaseMenuObject(MenuObject);
+            return ret;
+          }          
+        }
+        IntReleaseMenuObject(MenuObject);
+      }
       PrevItem = CurItem;
       CurItem = CurItem->Next;
       p++;
CVSspam 0.2.8