user32: HiliteMenuItem fails if an invalid window handle is passed to it.

This commit is contained in:
Reece H. Dunn 2008-03-17 08:59:16 +00:00 committed by Alexandre Julliard
parent 021019ff8f
commit efd0b9ae7a
1 changed files with 15 additions and 0 deletions

View File

@ -1874,6 +1874,21 @@ static void test_menu_hilitemenuitem( void )
AppendMenu(hPopupMenu, MF_STRING, 102, "Item 2");
AppendMenu(hPopupMenu, MF_STRING, 103, "Item 3");
ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
"HiliteMenuItem: Item 2 is hilited\n");
SetLastError(0xdeadbeef);
ok(!HiliteMenuItem(NULL, hPopupMenu, 1, MF_HILITE),
"HiliteMenuItem: call should have failed.\n");
todo_wine
{
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE,
"HiliteMenuItem: expected error ERROR_INVALID_WINDOW_HANDLE, got: %d\n", GetLastError());
}
ok(!(GetMenuState(hPopupMenu, 1, MF_BYPOSITION) & MF_HILITE),
"HiliteMenuItem: Item 2 is hilited\n");
HiliteMenuItem(NULL, hPopupMenu, 0, MF_HILITE);
HiliteMenuItem(NULL, hPopupMenu, 1, MF_HILITE);
HiliteMenuItem(NULL, hPopupMenu, 2, MF_HILITE);