mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NtUser|User32]
- Fix HiliteMenuItem tests, see CORE-7967. svn path=/trunk/; revision=62533
This commit is contained in:
parent
ac46205375
commit
7860a3e097
3 changed files with 24 additions and 24 deletions
|
@ -485,8 +485,11 @@ IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi)
|
|||
|
||||
|
||||
int FASTCALL
|
||||
IntGetMenuItemByFlag(PMENU_OBJECT Menu, UINT uSearchBy, UINT fFlag,
|
||||
PMENU_OBJECT *SubMenu, PMENU_ITEM *MenuItem,
|
||||
IntGetMenuItemByFlag(PMENU_OBJECT Menu,
|
||||
UINT uSearchBy,
|
||||
UINT fFlag,
|
||||
PMENU_OBJECT *SubMenu,
|
||||
PMENU_ITEM *MenuItem,
|
||||
PMENU_ITEM *PrevMenuItem)
|
||||
{
|
||||
PMENU_ITEM PrevItem = NULL;
|
||||
|
@ -1039,17 +1042,22 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck)
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
|
||||
UINT uItemHilite, UINT uHilite)
|
||||
IntHiliteMenuItem(PWND WindowObject,
|
||||
PMENU_OBJECT MenuObject,
|
||||
UINT uItemHilite,
|
||||
UINT uHilite)
|
||||
{
|
||||
PMENU_ITEM MenuItem;
|
||||
BOOL res = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL);
|
||||
if(!MenuItem || !res)
|
||||
int Pos;
|
||||
|
||||
Pos = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL);
|
||||
|
||||
if (!MenuItem || (uHilite & MF_BYPOSITION && Pos == -1))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(uHilite & MF_HILITE)
|
||||
if (uHilite & MF_HILITE)
|
||||
{
|
||||
MenuItem->fState |= MF_HILITE;
|
||||
}
|
||||
|
@ -2058,12 +2066,7 @@ NtUserHiliteMenuItem(
|
|||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
|
||||
{
|
||||
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
|
||||
}
|
||||
|
||||
RETURN(FALSE);
|
||||
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
|
||||
|
||||
CLEANUP:
|
||||
TRACE("Leave NtUserHiliteMenuItem, ret=%u\n",_ret_);
|
||||
|
@ -2224,7 +2227,7 @@ UserMenuItemInfo(
|
|||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
// This will crash menu (line 80) correct_behavior test!
|
||||
// "NT4 and below can't handle a bigger MENUITEMINFO struct"
|
||||
//EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND);
|
||||
// EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND);
|
||||
return( FALSE);
|
||||
}
|
||||
|
||||
|
|
|
@ -387,7 +387,7 @@
|
|||
@ stdcall GrayStringA(long long ptr long long long long long long)
|
||||
@ stdcall GrayStringW(long long ptr long long long long long long)
|
||||
@ stdcall HideCaret(long) NtUserHideCaret
|
||||
@ stdcall HiliteMenuItem(long long long long) NtUserHiliteMenuItem
|
||||
@ stdcall HiliteMenuItem(long long long long) ; Use both ReactOS and wine NtUserHiliteMenuItem
|
||||
@ stdcall IMPGetIMEA(long ptr)
|
||||
@ stdcall IMPGetIMEW(long ptr)
|
||||
@ stdcall IMPQueryIMEA(ptr)
|
||||
|
|
|
@ -4181,20 +4181,17 @@ EndMenu(VOID)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// So this one maybe one day it will be a callback!
|
||||
BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
|
||||
UINT wHilite )
|
||||
{
|
||||
ROSMENUINFO MenuInfo;
|
||||
ROSMENUITEMINFO mii;
|
||||
TRACE("(%p, %p, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite);
|
||||
if (!hWnd)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (!NtUserMenuItemInfo(hMenu, wItemID, wHilite, &mii, FALSE)) return FALSE;
|
||||
if (!NtUserMenuInfo(hMenu, &MenuInfo, FALSE)) return FALSE;
|
||||
// Force bits to be set call server side....
|
||||
// This alone works and passes all the menu test_menu_hilitemenuitem tests.
|
||||
if (!NtUserHiliteMenuItem(hWnd, hMenu, wItemID, wHilite)) return FALSE;
|
||||
// Without the above call we fail 3 out of the wine failed todo tests, see CORE-7967
|
||||
// Now redraw menu.
|
||||
if (!MenuGetRosMenuInfo(&MenuInfo, hMenu)) return FALSE;
|
||||
if (MenuInfo.FocusedItem == wItemID) return TRUE;
|
||||
MenuHideSubPopups( hWnd, &MenuInfo, FALSE, 0 );
|
||||
MenuSelectItem( hWnd, &MenuInfo, wItemID, TRUE, 0 );
|
||||
|
|
Loading…
Reference in a new issue