Thread: SetMenuItemInfo

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    SetMenuItemInfo

    I cant get it to work (SetMenuItemInfo)
    heres my code
    MENUITEMINFO mii;
    mii.fMask=MIIM_TYPE;
    mii.fType = MFT_STRING;
    mii.dwTypeData="string"
    SetMenuItem(hMenu,/* Declared In resource along with menu item IDB_TEST*/IDB_TEST,FALSE,&mii);
    DrawMenuBar(hwnd);
    /*dont wory i did set it origanally/*
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Try setting mmi.fMask to MIIM_STRING.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    i did but my compiler could'nt find MIIM_STRING
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    What compiler are you using (version would be handy too)?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    Metrowerks codewarrior
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  6. #6
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    MENUITEMINFO is declared in winuser.h. I have metrowerks codewarrior 5 and MIIM_STRING is declared ok in there but in order for it to be defined you should:

    #define WINVER 0x0500

    before you #include <windows.h>

    That should compile ok.

    Good luck.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  7. #7
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    hmm id didnt work i have ver. 4 but i still tried by the way do you like metrowerks
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  8. #8
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Did it compile ok? And what os are you compiling on?

    If not try (before #include <windows.h> ):
    Code:
    #if !defined MIIM_STRING
    #define MIIM_STRING 0x00000040
    #endif
    >>do you like metrowerks<<

    I got codewarrior 5 Pro (IDE version 4) as a freebie on a magazine cd in the UK thanks to Fordy without whom i'd never have a chance to play around with yet another compiler. It's ok, but I confess i've not really messed around with it that much. The IDE is nice enough with decent enough help files which is always a bonus.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  9. #9
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125
    even with the paramater it dosent work any altenatives?
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  10. #10
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Short of upgrading your compiler or getting a new one, you could try the older ModifyMenu function.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  11. #11
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I think it would be beneficial for you to post some code showing what you have been doing....

    This is a simple system call and the compiler should be able to do what's needed....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM