mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Implemented NtUser-GetMenuItemRect.
svn path=/trunk/; revision=16612
This commit is contained in:
parent
612346a8b7
commit
56d1785ca5
2 changed files with 46 additions and 6 deletions
|
@ -3792,7 +3792,7 @@ GetMenuItemInfoW(
|
|||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOL STDCALL
|
||||
GetMenuItemRect(HWND hWnd,
|
||||
|
@ -3800,8 +3800,7 @@ GetMenuItemRect(HWND hWnd,
|
|||
UINT uItem,
|
||||
LPRECT lprcItem)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return(FALSE);
|
||||
return NtUserGetMenuItemRect( hWnd, hMenu, uItem, lprcItem);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1558,7 +1558,7 @@ NtUserGetMenuIndex(
|
|||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOL STDCALL
|
||||
NtUserGetMenuItemRect(
|
||||
|
@ -1567,9 +1567,50 @@ NtUserGetMenuItemRect(
|
|||
UINT uItem,
|
||||
LPRECT lprcItem)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
ROSMENUINFO mi;
|
||||
ROSMENUITEMINFO mii;
|
||||
HWND referenceHwnd;
|
||||
LPPOINT lpPoints;
|
||||
LPRECT lpRect;
|
||||
POINT FromOffset;
|
||||
LONG XMove, YMove;
|
||||
ULONG i;
|
||||
NTSTATUS Status;
|
||||
|
||||
if(!NtUserMenuItemInfo(hMenu, uItem, MF_BYPOSITION, &mii, FALSE))
|
||||
return FALSE;
|
||||
|
||||
referenceHwnd = hWnd;
|
||||
|
||||
return 0;
|
||||
if(!hWnd)
|
||||
{
|
||||
if(!NtUserMenuInfo(hMenu, &mi, FALSE)) return FALSE;
|
||||
if(mi.Wnd == 0) return FALSE;
|
||||
referenceHwnd = mi.Wnd;
|
||||
}
|
||||
|
||||
if (lprcItem == NULL) return FALSE;
|
||||
*lpRect = mii.Rect;
|
||||
lpPoints = (LPPOINT)lpRect;
|
||||
|
||||
if(!NtUserGetClientOrigin(referenceHwnd, &FromOffset)) return FALSE;
|
||||
|
||||
XMove = FromOffset.x;
|
||||
YMove = FromOffset.y;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
lpPoints[i].x += XMove;
|
||||
lpPoints[i].y += YMove;
|
||||
}
|
||||
|
||||
Status = MmCopyToCaller(lprcItem, lpPoints, sizeof(POINT));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue