2003-01-08 Peter Gerwinski * controls/menu.c (MENU_FindItem): Check for MS_POPUP first before looking at item->wID (which might be bogus). --- menu.c.orig Wed Jan 8 14:08:24 2003 +++ menu.c Wed Jan 8 14:06:13 2003 @@ -562,12 +562,7 @@ MENUITEM *item = menu->items; for (i = 0; i < menu->nItems; i++, item++) { - if (item->wID == *nPos) - { - *nPos = i; - return item; - } - else if (item->fType & MF_POPUP) + if (item->fType & MF_POPUP) { HMENU hsubmenu = item->hSubMenu; MENUITEM *subitem = MENU_FindItem( &hsubmenu, nPos, wFlags ); @@ -576,6 +571,11 @@ *hmenu = hsubmenu; return subitem; } + } + else if (item->wID == *nPos) + { + *nPos = i; + return item; } } }