problum with dropdown

This is a discussion on problum with dropdown within the Windows Programming forums, part of the Platform Specific Boards category; hi all i'm new to this site but was just wondering if some body can advise me on how drop ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    8

    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

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    8
    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

  3. #3
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    tubro c++ is windows i do believe, he should be ok with it.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    8
    RoD
    Do you know anything about dropdown meuns in c please

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    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?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    8
    novacain

    i will play with the code & see what i can now do

    many thanks for your help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DropDown menu help
    By houssam_ballout in forum C++ Programming
    Replies: 2
    Last Post: 04-27-2006, 04:55 AM
  2. dropdown list? / reg? problems
    By willc0de4food in forum Windows Programming
    Replies: 2
    Last Post: 02-06-2006, 06:58 PM
  3. display a file in dropdown edit box
    By sunburnbyRA in forum Windows Programming
    Replies: 2
    Last Post: 03-10-2004, 01:58 PM
  4. dropdown box blues
    By DarkViper in forum Windows Programming
    Replies: 1
    Last Post: 03-08-2004, 12:08 PM
  5. Links in dropdown menus with FrontPage
    By sean in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-28-2002, 07:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21