mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:05:42 +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
|
int FASTCALL
|
||||||
IntGetMenuItemByFlag(PMENU_OBJECT Menu, UINT uSearchBy, UINT fFlag,
|
IntGetMenuItemByFlag(PMENU_OBJECT Menu,
|
||||||
PMENU_OBJECT *SubMenu, PMENU_ITEM *MenuItem,
|
UINT uSearchBy,
|
||||||
|
UINT fFlag,
|
||||||
|
PMENU_OBJECT *SubMenu,
|
||||||
|
PMENU_ITEM *MenuItem,
|
||||||
PMENU_ITEM *PrevMenuItem)
|
PMENU_ITEM *PrevMenuItem)
|
||||||
{
|
{
|
||||||
PMENU_ITEM PrevItem = NULL;
|
PMENU_ITEM PrevItem = NULL;
|
||||||
|
@ -1039,17 +1042,22 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
|
IntHiliteMenuItem(PWND WindowObject,
|
||||||
UINT uItemHilite, UINT uHilite)
|
PMENU_OBJECT MenuObject,
|
||||||
|
UINT uItemHilite,
|
||||||
|
UINT uHilite)
|
||||||
{
|
{
|
||||||
PMENU_ITEM MenuItem;
|
PMENU_ITEM MenuItem;
|
||||||
BOOL res = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL);
|
int Pos;
|
||||||
if(!MenuItem || !res)
|
|
||||||
|
Pos = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL);
|
||||||
|
|
||||||
|
if (!MenuItem || (uHilite & MF_BYPOSITION && Pos == -1))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(uHilite & MF_HILITE)
|
if (uHilite & MF_HILITE)
|
||||||
{
|
{
|
||||||
MenuItem->fState |= MF_HILITE;
|
MenuItem->fState |= MF_HILITE;
|
||||||
}
|
}
|
||||||
|
@ -2058,12 +2066,7 @@ NtUserHiliteMenuItem(
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
|
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
|
||||||
{
|
|
||||||
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
|
|
||||||
}
|
|
||||||
|
|
||||||
RETURN(FALSE);
|
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
TRACE("Leave NtUserHiliteMenuItem, ret=%u\n",_ret_);
|
TRACE("Leave NtUserHiliteMenuItem, ret=%u\n",_ret_);
|
||||||
|
@ -2224,7 +2227,7 @@ UserMenuItemInfo(
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
// This will crash menu (line 80) correct_behavior test!
|
// This will crash menu (line 80) correct_behavior test!
|
||||||
// "NT4 and below can't handle a bigger MENUITEMINFO struct"
|
// "NT4 and below can't handle a bigger MENUITEMINFO struct"
|
||||||
//EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND);
|
// EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND);
|
||||||
return( FALSE);
|
return( FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@
|
||||||
@ stdcall GrayStringA(long long ptr long long long long long long)
|
@ stdcall GrayStringA(long long ptr long long long long long long)
|
||||||
@ stdcall GrayStringW(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 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 IMPGetIMEA(long ptr)
|
||||||
@ stdcall IMPGetIMEW(long ptr)
|
@ stdcall IMPGetIMEW(long ptr)
|
||||||
@ stdcall IMPQueryIMEA(ptr)
|
@ stdcall IMPQueryIMEA(ptr)
|
||||||
|
|
|
@ -4181,20 +4181,17 @@ EndMenu(VOID)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// So this one maybe one day it will be a callback!
|
|
||||||
BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
|
BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
|
||||||
UINT wHilite )
|
UINT wHilite )
|
||||||
{
|
{
|
||||||
ROSMENUINFO MenuInfo;
|
ROSMENUINFO MenuInfo;
|
||||||
ROSMENUITEMINFO mii;
|
|
||||||
TRACE("(%p, %p, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite);
|
TRACE("(%p, %p, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite);
|
||||||
if (!hWnd)
|
// Force bits to be set call server side....
|
||||||
{
|
// This alone works and passes all the menu test_menu_hilitemenuitem tests.
|
||||||
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
if (!NtUserHiliteMenuItem(hWnd, hMenu, wItemID, wHilite)) return FALSE;
|
||||||
return FALSE;
|
// Without the above call we fail 3 out of the wine failed todo tests, see CORE-7967
|
||||||
}
|
// Now redraw menu.
|
||||||
if (!NtUserMenuItemInfo(hMenu, wItemID, wHilite, &mii, FALSE)) return FALSE;
|
if (!MenuGetRosMenuInfo(&MenuInfo, hMenu)) return FALSE;
|
||||||
if (!NtUserMenuInfo(hMenu, &MenuInfo, FALSE)) return FALSE;
|
|
||||||
if (MenuInfo.FocusedItem == wItemID) return TRUE;
|
if (MenuInfo.FocusedItem == wItemID) return TRUE;
|
||||||
MenuHideSubPopups( hWnd, &MenuInfo, FALSE, 0 );
|
MenuHideSubPopups( hWnd, &MenuInfo, FALSE, 0 );
|
||||||
MenuSelectItem( hWnd, &MenuInfo, wItemID, TRUE, 0 );
|
MenuSelectItem( hWnd, &MenuInfo, wItemID, TRUE, 0 );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue