dropdown or pop-up?
Tried the resource editor?
else new drop downs
Code:
hMainMenu=GetMenu(hWnd);
//set up menu item info struct
ZeroMemory(&MenuItemInfo,sizeof(MENUITEMINFO));
MenuItemInfo.cbSize=sizeof(MENUITEMINFO);
MenuItemInfo.wID=iMenuID;
MenuItemInfo.fMask=MIIM_DATA|MIIM_ID|MIIM_TYPE|MIIM_ID| MIIM_CHECKMARKS |MIIM_STATE;
MenuItemInfo.fType=MFT_STRING;
MenuItemInfo.dwTypeData=sItemName;
MenuItemInfo.hbmpChecked=NULL;
MenuItemInfo.hbmpUnchecked=NULL;
MenuItemInfo.fState=MFS_ENABLED;
MenuItemInfo.hSubMenu=NULL;
MenuItemInfo.cch=256;
//insert by ID number
InsertMenuItem(hMainMenu,MenuItemInfo.wID,FALSE,&MenuItemInfo);
//insert by position, use an int, zero based inc seperators
iPos=1;
InsertMenuItem(hMainMenu,iPos,TRUE,&MenuItemInfo);
to get a dropdown insert the menu item by position or ID
then use this to get its HWND
hSubMenu=GetSubMenu(hMainMenu,iPos);
now if you set the
MenuItemInfo.hSubMenu=hSubMenu;
you should be able to insert menu items into the new drop down. Remember (if inserting by position) to count seperators, count down starting at zero.
If an item is deleted in the menu, all the items after position changes.
use this to get info about the menu if you need the state ect
experiment by calling it on menu items you create (and so know WHAT you should get, then you can modify to get what you want)
GetMenuItemInfo(hPopUp,ID_MENUITEM_ID,FALSE,&MenuI temInfo);
Clear as mud?