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. Menu Notifications on MFC

Menu Notifications on MFC

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
11 Posts 4 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.
  • B Offline
    B Offline
    blackbondi
    wrote on last edited by
    #1

    Hi, How can I use these menu notifications on MFC: WM_COMMAND WM_CONTEXTMENU WM_ENTERMENULOOP WM_EXITMENULOOP WM_GETTITLEBARINFOEX WM_MENUCOMMAND WM_MENUDRAG WM_MENUGETOBJECT WM_MENURBUTTONUP WM_NEXTMENU WM_UNINITMENUPOPUP I didn't find anything on the MSDN Library. Can anybody explain me the messaging routing of the menu object? Thx

    CPalliniC D H 3 Replies Last reply
    0
    • B blackbondi

      Hi, How can I use these menu notifications on MFC: WM_COMMAND WM_CONTEXTMENU WM_ENTERMENULOOP WM_EXITMENULOOP WM_GETTITLEBARINFOEX WM_MENUCOMMAND WM_MENUDRAG WM_MENUGETOBJECT WM_MENURBUTTONUP WM_NEXTMENU WM_UNINITMENUPOPUP I didn't find anything on the MSDN Library. Can anybody explain me the messaging routing of the menu object? Thx

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      If you recognize that often MFC is only a thin wrapper around Win32 API then you may find a lot of info on MSDN http://msdn2.microsoft.com/en-us/library/ms674668%28VS.85%29.aspx[^] :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      [my articles]

      In testa che avete, signor di Ceprano?

      B 1 Reply Last reply
      0
      • B blackbondi

        Hi, How can I use these menu notifications on MFC: WM_COMMAND WM_CONTEXTMENU WM_ENTERMENULOOP WM_EXITMENULOOP WM_GETTITLEBARINFOEX WM_MENUCOMMAND WM_MENUDRAG WM_MENUGETOBJECT WM_MENURBUTTONUP WM_NEXTMENU WM_UNINITMENUPOPUP I didn't find anything on the MSDN Library. Can anybody explain me the messaging routing of the menu object? Thx

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Have you tried via ClassWizard (Ctrl+W)?

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        B 2 Replies Last reply
        0
        • B blackbondi

          Hi, How can I use these menu notifications on MFC: WM_COMMAND WM_CONTEXTMENU WM_ENTERMENULOOP WM_EXITMENULOOP WM_GETTITLEBARINFOEX WM_MENUCOMMAND WM_MENUDRAG WM_MENUGETOBJECT WM_MENURBUTTONUP WM_NEXTMENU WM_UNINITMENUPOPUP I didn't find anything on the MSDN Library. Can anybody explain me the messaging routing of the menu object? Thx

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          It depends to your work,what do you need?

          B 1 Reply Last reply
          0
          • H Hamid Taebi

            It depends to your work,what do you need?

            B Offline
            B Offline
            blackbondi
            wrote on last edited by
            #5

            I want to implement the messages. WM_MENURBUTTONUP WM_MENUDRAG thx

            H 1 Reply Last reply
            0
            • CPalliniC CPallini

              If you recognize that often MFC is only a thin wrapper around Win32 API then you may find a lot of info on MSDN http://msdn2.microsoft.com/en-us/library/ms674668%28VS.85%29.aspx[^] :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              [my articles]

              B Offline
              B Offline
              blackbondi
              wrote on last edited by
              #6

              I know that, but I didn't find the wrapper (command-handler member function) for these messages in the CMenu class, e.g the command-handler member function for WM_CREATE is OnCreate etc. My idea is to inherit a class from CMenu and add the message handler-functions for these messages, is that correct?

              1 Reply Last reply
              0
              • D David Crow

                Have you tried via ClassWizard (Ctrl+W)?

                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                B Offline
                B Offline
                blackbondi
                wrote on last edited by
                #7

                What do you mean with "via ClassWizard"? Creating a class inherited from CMenu? When I tried to adding an event handler to the menu resource via the Event Handler Wizard I only found the messages COMMAND and UPDATE_COMMAND_UI

                D 1 Reply Last reply
                0
                • D David Crow

                  Have you tried via ClassWizard (Ctrl+W)?

                  "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  B Offline
                  B Offline
                  blackbondi
                  wrote on last edited by
                  #8

                  I even can't inherit a class from CMenu via ClassWizard, because it isn't listed in the "Base class" combobox

                  1 Reply Last reply
                  0
                  • B blackbondi

                    What do you mean with "via ClassWizard"? Creating a class inherited from CMenu? When I tried to adding an event handler to the menu resource via the Event Handler Wizard I only found the messages COMMAND and UPDATE_COMMAND_UI

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #9

                    blackbondi wrote:

                    What do you mean with "via ClassWizard"?

                    Via means by way of.

                    blackbondi wrote:

                    Creating a class inherited from CMenu?

                    Among other things, like adding member/control variables, and creating event handlers.

                    blackbondi wrote:

                    When I tried to adding an event handler to the menu resource via the Event Handler Wizard I only found the messages COMMAND and UPDATE_COMMAND_UI

                    The list of messages will depend on what object you currently have selected. For you to only be seeing COMMAND and UPDATE_COMMAND_UI, you probably have a menu item selected. What version of Visual Studio are you using?

                    "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    B 1 Reply Last reply
                    0
                    • D David Crow

                      blackbondi wrote:

                      What do you mean with "via ClassWizard"?

                      Via means by way of.

                      blackbondi wrote:

                      Creating a class inherited from CMenu?

                      Among other things, like adding member/control variables, and creating event handlers.

                      blackbondi wrote:

                      When I tried to adding an event handler to the menu resource via the Event Handler Wizard I only found the messages COMMAND and UPDATE_COMMAND_UI

                      The list of messages will depend on what object you currently have selected. For you to only be seeing COMMAND and UPDATE_COMMAND_UI, you probably have a menu item selected. What version of Visual Studio are you using?

                      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      B Offline
                      B Offline
                      blackbondi
                      wrote on last edited by
                      #10

                      Yes but like so I can't add the event handler for the two messages I want. The version is Visual Studio 2008.

                      1 Reply Last reply
                      0
                      • B blackbondi

                        I want to implement the messages. WM_MENURBUTTONUP WM_MENUDRAG thx

                        H Offline
                        H Offline
                        Hamid Taebi
                        wrote on last edited by
                        #11

                        See An examination of menus from a beginner's point of view[^].

                        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