diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 76fcd703615..7a49ac04e66 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -3033,6 +3033,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, if (!(wFlags & TPM_POPUPMENU)) set_capture_window( mt.hOwnerWnd, GUI_INMENUMODE, NULL ); + if ((wFlags & TPM_POPUPMENU) && menu->nItems == 0) + return FALSE; + __TRY while (!fEndMenu) { menu = MENU_GetMenu( mt.hCurrentMenu ); diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 88b9df9bdc1..65c8e932c96 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -3820,25 +3820,25 @@ static void test_emptypopup(void) ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); - todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); - todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); - todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; selectitem_wp = 0xdeadbeef; selectitem_lp = 0xdeadbeef; ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL); - todo_wine ok(ret == 0, "got %i\n", ret); + ok(ret == 0, "got %i\n", ret); ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); - todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); - todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); - todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_fill_in_init); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 47d754fc4c0..97bf443c7db 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -15373,7 +15373,7 @@ static void test_TrackPopupMenuEmpty(void) flush_sequence(); ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); ok_sequence(WmTrackPopupMenuEmpty, "TrackPopupMenuEmpty", TRUE); - todo_wine ok(ret == 0, "TrackPopupMenu succeeded\n"); + ok(ret == 0, "TrackPopupMenu succeeded\n"); DestroyMenu(hpopupmenu); DestroyWindow(hwnd);