Fix call to GetMenuItemInfo and unicodify while we're at it.

This commit is contained in:
Huw Davies 2005-08-08 11:02:16 +00:00 committed by Alexandre Julliard
parent bcd8fa3c78
commit 91358d76c3
1 changed files with 7 additions and 6 deletions

View File

@ -1961,14 +1961,14 @@ HRESULT WINAPI IUnknown_HandleIRestrict(LPUNKNOWN lpUnknown, PVOID lpArg1,
*/ */
HMENU WINAPI SHGetMenuFromID(HMENU hMenu, UINT uID) HMENU WINAPI SHGetMenuFromID(HMENU hMenu, UINT uID)
{ {
MENUITEMINFOA mi; MENUITEMINFOW mi;
TRACE("(%p,%uld)\n", hMenu, uID); TRACE("(%p,%uld)\n", hMenu, uID);
mi.cbSize = sizeof(MENUITEMINFOA); mi.cbSize = sizeof(mi);
mi.fMask = MIIM_SUBMENU; mi.fMask = MIIM_SUBMENU;
if (!GetMenuItemInfoA(hMenu, uID, 0, &mi)) if (!GetMenuItemInfoW(hMenu, uID, FALSE, &mi))
return NULL; return NULL;
return mi.hSubMenu; return mi.hSubMenu;
@ -4121,13 +4121,14 @@ BOOL WINAPI SHIsLowMemoryMachine (DWORD x)
*/ */
INT WINAPI GetMenuPosFromID(HMENU hMenu, UINT wID) INT WINAPI GetMenuPosFromID(HMENU hMenu, UINT wID)
{ {
MENUITEMINFOA mi; MENUITEMINFOW mi;
INT nCount = GetMenuItemCount(hMenu), nIter = 0; INT nCount = GetMenuItemCount(hMenu), nIter = 0;
while (nIter < nCount) while (nIter < nCount)
{ {
mi.wID = 0; mi.cbSize = sizeof(mi);
if (!GetMenuItemInfoA(hMenu, nIter, TRUE, &mi) && mi.wID == wID) mi.fMask = MIIM_ID;
if (GetMenuItemInfoW(hMenu, nIter, TRUE, &mi) && mi.wID == wID)
return nIter; return nIter;
nIter++; nIter++;
} }