Thread: Using menu resource

  1. #1

    Using menu resource

    If you have a compiled menu resource, how can you get at it? I am toying with the idea of a custom menu control, similar to that of ms apps ( eg office 2k ).

    It'd be really cool if I could just use a menu resource to make it but I'm unsure about how to get the popup menus and submenus etc ..

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    87
    If you are programming with MFC, a class that might help you is CMenu.

    See its methods.

  3. #3
    I'm using the API.

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    87
    So check the topic:
    SetMenu- Windows User Interface Platform SDK in MSDN

    there is a link called Menu Functions
    there are all the menu functions.

  5. #5
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    If you want your menu to be custom drawn, you'll have to owner draw it.

  6. #6
    I don't think we are on the same train of thought, I don't think I explained it well after reading my initial post... sorry.

    What I mean is to be able to access the data of the menu which was in the resource script to use in painting and handling events on the menu.

    Like, can I enumerate the menus, submenus and menuitems of a menu created in a resource file??

    I had a look through MSDN but didn't find anything seemingly relevant.

  7. #7
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Use LoadMenu to load the menu from the resource file.

    Use the GetMenuInfo and GetSubMenu functions to get descendent menus and menu items.

  8. #8
    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 03:41 AM
  4. VC++ 6 Menu resource question
    By Mecnels in forum Windows Programming
    Replies: 1
    Last Post: 04-22-2003, 12:04 PM
  5. menu resource file
    By satriani in forum Windows Programming
    Replies: 5
    Last Post: 06-08-2002, 10:52 PM