diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 6b0cf2f7f84..ab3f73b246e 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -3859,7 +3859,7 @@ static void MENU_mnu2mnuii( UINT flags, UINT_PTR id, LPCWSTR str, pmii->fMask |= MIIM_DATA; pmii->dwItemData = (ULONG_PTR) str; } - if( flags & MF_POPUP) { + if( flags & MF_POPUP && MENU_GetMenu((HMENU)id)) { pmii->fMask |= MIIM_SUBMENU; pmii->hSubMenu = (HMENU)id; } diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 2f3c481e9db..593292dfcdd 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -3639,18 +3639,14 @@ static void test_AppendMenu(void) hmenu = CreateMenu(); ok(hmenu != 0, "CreateMenu failed\n"); ret = AppendMenuA(hmenu, MF_POPUP, 202, "item 1"); -todo_wine ok(ret, "AppendMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 202, MF_STRING, 0); DestroyMenu(hmenu); hmenu = CreateMenu(); ok(hmenu != 0, "CreateMenu failed\n"); ret = AppendMenuA(hmenu, MF_OWNERDRAW | MF_POPUP, 203, "item 1"); -todo_wine ok(ret, "AppendMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 203, MF_OWNERDRAW, 0); DestroyMenu(hmenu); @@ -3720,9 +3716,7 @@ if (ret) /* FIXME: uncomment once Wine is fixed */ ok(ret, "AppendMenu failed\n"); check_menu_items(hmenu, 204, MF_STRING, 0); ret = ModifyMenuA(hmenu, 0, MF_POPUP | MF_BYPOSITION, 205, "item 2"); -todo_wine ok(ret, "ModifyMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 205, MF_STRING, 0); memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii);