Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. adding functions to submenus

adding functions to submenus

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rajveer
    wrote on last edited by
    #1

    I noticed that when you make a new submenu for any of the menus, you can add a function for COMMAND or UPDATE_COMMAND_UI What do these two things mean?

    T D 2 Replies Last reply
    0
    • R Rajveer

      I noticed that when you make a new submenu for any of the menus, you can add a function for COMMAND or UPDATE_COMMAND_UI What do these two things mean?

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      COMMAND handler is called when user clicks on the menu item - you put the real work there. UPDATE_COMMAND_UI is called in response to WM_INITMENUPOPUP, just before displaying the menu. It gives you the opportunity to enable/disable/check/change the text of menu item. If your menu item is always enabled, you don't need UPDATE_COMMAND_UI. Tomasz Sowinski -- http://www.shooltz.com

      - It's for protection
      - Protection from what? Zee Germans?

      1 Reply Last reply
      0
      • R Rajveer

        I noticed that when you make a new submenu for any of the menus, you can add a function for COMMAND or UPDATE_COMMAND_UI What do these two things mean?

        D Offline
        D Offline
        Dy
        wrote on last edited by
        #3

        Not sure if I've understood what your saying properly, but ON_COMMAND is where you tell your class what to do upon receiving that command message and ON_UPDATE_COMMAND is where you tell your class what to do when that menu needs to be updated (in your AFX_MSG_MAP part of your message map) E.g.: ON_COMMAND(ID_OPTIONS_FONT, OnOptionsFont) ON_UPDATE_COMMAND_UI(ID_OPTIONS_FONT, OnUpdateOptionsFont) Heres the MSDN info: ON_COMMAND, ON_UPDATE_COMMAND_UI Dylan Kenneally London,UK

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups