mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 02:21:22 +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
|
BOOL STDCALL
|
||||||
GetMenuItemRect(HWND hWnd,
|
GetMenuItemRect(HWND hWnd,
|
||||||
|
@ -3800,8 +3800,7 @@ GetMenuItemRect(HWND hWnd,
|
||||||
UINT uItem,
|
UINT uItem,
|
||||||
LPRECT lprcItem)
|
LPRECT lprcItem)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
return NtUserGetMenuItemRect( hWnd, hMenu, uItem, lprcItem);
|
||||||
return(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1558,7 +1558,7 @@ NtUserGetMenuIndex(
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
NtUserGetMenuItemRect(
|
NtUserGetMenuItemRect(
|
||||||
|
@ -1567,9 +1567,50 @@ NtUserGetMenuItemRect(
|
||||||
UINT uItem,
|
UINT uItem,
|
||||||
LPRECT lprcItem)
|
LPRECT lprcItem)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
ROSMENUINFO mi;
|
||||||
|
ROSMENUITEMINFO mii;
|
||||||
|
HWND referenceHwnd;
|
||||||
|
LPPOINT lpPoints;
|
||||||
|
LPRECT lpRect;
|
||||||
|
POINT FromOffset;
|
||||||
|
LONG XMove, YMove;
|
||||||
|
ULONG i;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
return 0;
|
if(!NtUserMenuItemInfo(hMenu, uItem, MF_BYPOSITION, &mii, FALSE))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
referenceHwnd = hWnd;
|
||||||
|
|
||||||
|
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…
Add table
Add a link
Reference in a new issue