Using menu resource

This is a discussion on Using menu resource within the Windows Programming forums, part of the Platform Specific Boards category; If you have a compiled menu resource, how can you get at it? I am toying with the idea of ...

  1. #1
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293

    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
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    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
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    If you want your menu to be custom drawn, you'll have to owner draw it.

  6. #6
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    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
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    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
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    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, 02:01 AM
  3. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 04:41 AM
  4. VC++ 6 Menu resource question
    By Mecnels in forum Windows Programming
    Replies: 1
    Last Post: 04-22-2003, 01:04 PM
  5. menu resource file
    By satriani in forum Windows Programming
    Replies: 5
    Last Post: 06-08-2002, 11:52 PM

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