Commit efd0b9ae authored by Reece H. Dunn's avatar Reece H. Dunn Committed by Alexandre Julliard

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

parent 021019ff
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment