-
problum with dropdown
hi all
i'm new to this site but was just wondering if some body can advise me on how drop down meuns are created.
i am at college and i have been giving a project to design a c program to launch a rocket but it is to have different engine types + different nose cone & fin types, the only way i think i can get this done is with dropdown meuns, if anyone can advice on a differant way that would be easer i would be greatfull other wise
any advise would be great
i am using windows 2000 & borlands turbo c++ ver 3.0
i was told this is where i need to post the question
many thanks
-
given the chance to update my compiler i would but in college we have been told that this is what we must use, so it's not my choice, i only wish it was
thanks
-
tubro c++ is windows i do believe, he should be ok with it.
-
RoD
Do you know anything about dropdown meuns in c please
-
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?
-
novacain
i will play with the code & see what i can now do
many thanks for your help