Reece H. Dunn : user32: HiliteMenuItem fails if an invalid window handle is passed to it.
Alexandre Julliard
julliard at winehq.org
Mon Mar 17 10:46:39 CDT 2008
Module: wine
Branch: master
Commit: efd0b9ae7a8d19ee15c11eb6d5b4b3a2bd0bd6c1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=efd0b9ae7a8d19ee15c11eb6d5b4b3a2bd0bd6c1
Author: Reece H. Dunn <msclrhd at gmail.com>
Date: Mon Mar 17 08:59:16 2008 +0000
user32: HiliteMenuItem fails if an invalid window handle is passed to it.
---
dlls/user32/tests/menu.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index 99974b0..5f900d0 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -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);
More information about the wine-cvs
mailing list