Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
532 B

#include "priv.h"
#pragma hdrstop
int GetMenuPosFromID(HMENU hmenu, UINT id)
{
int iPos = -1;
int cItems = GetMenuItemCount(hmenu);
int i;
for (i=0; i<cItems;i++)
{
MENUITEMINFO mii;
mii.cbSize = SIZEOF(mii);
mii.fMask = MIIM_ID;
mii.wID = 0;
if (GetMenuItemInfo(hmenu, i, TRUE, &mii))
{
if (mii.wID == id)
{
iPos = i;
break;
}
}
}
return iPos;
}