Menu Notifications on MFC
-
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
-
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
If you recognize that often
MFC
is only a thin wrapper aroundWin32 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] -
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
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
-
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
It depends to your work,what do you need?
-
It depends to your work,what do you need?
I want to implement the messages. WM_MENURBUTTONUP WM_MENUDRAG thx
-
If you recognize that often
MFC
is only a thin wrapper aroundWin32 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]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?
-
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
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
-
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
I even can't inherit a class from CMenu via ClassWizard, because it isn't listed in the "Base class" combobox
-
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
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
-
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
Yes but like so I can't add the event handler for the two messages I want. The version is Visual Studio 2008.
-
I want to implement the messages. WM_MENURBUTTONUP WM_MENUDRAG thx