Implemented NtUser-GetMenuItemRect.
Modified: trunk/reactos/lib/user32/windows/menu.c
Modified: trunk/reactos/subsys/win32k/ntuser/menu.c
_____
Modified: trunk/reactos/lib/user32/windows/menu.c
--- trunk/reactos/lib/user32/windows/menu.c 2005-07-17 12:24:15 UTC
(rev 16611)
+++ trunk/reactos/lib/user32/windows/menu.c 2005-07-17 12:26:24 UTC
(rev 16612)
@@ -3792,7 +3792,7 @@
/*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
GetMenuItemRect(HWND hWnd,
@@ -3800,8 +3800,7 @@
UINT uItem,
LPRECT lprcItem)
{
- UNIMPLEMENTED;
- return(FALSE);
+ return NtUserGetMenuItemRect( hWnd, hMenu, uItem, lprcItem);
}
_____
Modified: trunk/reactos/subsys/win32k/ntuser/menu.c
--- trunk/reactos/subsys/win32k/ntuser/menu.c 2005-07-17 12:24:15 UTC
(rev 16611)
+++ trunk/reactos/subsys/win32k/ntuser/menu.c 2005-07-17 12:26:24 UTC
(rev 16612)
@@ -1558,7 +1558,7 @@
/*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
NtUserGetMenuItemRect(
@@ -1567,9 +1567,50 @@
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;
}
Show replies by date