Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List Box & Rich Edit box Pin
prasad_som16-Feb-07 1:20
prasad_som16-Feb-07 1:20 
AnswerRe: List Box & Rich Edit box Pin
prasad_som16-Feb-07 1:18
prasad_som16-Feb-07 1:18 
GeneralRe: List Box & Rich Edit box Pin
Suresh H16-Feb-07 1:21
Suresh H16-Feb-07 1:21 
GeneralRe: List Box & Rich Edit box Pin
Hamid_RT16-Feb-07 1:27
Hamid_RT16-Feb-07 1:27 
GeneralRe: List Box & Rich Edit box Pin
Suresh H16-Feb-07 1:32
Suresh H16-Feb-07 1:32 
GeneralRe: List Box & Rich Edit box Pin
Hamid_RT16-Feb-07 1:45
Hamid_RT16-Feb-07 1:45 
AnswerRe: List Box & Rich Edit box Pin
prasad_som16-Feb-07 1:30
prasad_som16-Feb-07 1:30 
GeneralRe: List Box & Rich Edit box Pin
Suresh H16-Feb-07 1:34
Suresh H16-Feb-07 1:34 
GeneralRe: List Box & Rich Edit box Pin
Hamid_RT16-Feb-07 1:46
Hamid_RT16-Feb-07 1:46 
GeneralRe: List Box & Rich Edit box Pin
Suresh H16-Feb-07 1:26
Suresh H16-Feb-07 1:26 
AnswerRe: List Box & Rich Edit box Pin
prasad_som16-Feb-07 2:15
prasad_som16-Feb-07 2:15 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 19:12
Suresh H18-Feb-07 19:12 
GeneralRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 19:14
prasad_som18-Feb-07 19:14 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 19:52
Suresh H18-Feb-07 19:52 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 20:09
prasad_som18-Feb-07 20:09 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 20:20
Suresh H18-Feb-07 20:20 
GeneralRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 20:32
prasad_som18-Feb-07 20:32 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 20:50
Suresh H18-Feb-07 20:50 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 22:00
prasad_som18-Feb-07 22:00 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 22:48
Suresh H18-Feb-07 22:48 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 22:52
prasad_som18-Feb-07 22:52 
AnswerRe: List Box & Rich Edit box Pin
David Crow16-Feb-07 2:52
David Crow16-Feb-07 2:52 
QuestionWindows Menus and the WM_MENUCOMMAND message Pin
Martin081515-Feb-07 22:41
professionalMartin081515-Feb-07 22:41 
Hello,

I'm working with/on an application with a resource based menu. This application is more or less driven by the programming (script) language tcl and has a lot of APIs introducing C++ functionality to tcl.

Now I built an API to manage (popup) menus and their menu items, to create new items with tcl script callbacks, etc.

The main point in my "construct" is to use a template menu item from a template menu resource.
I created a menu in the resources as template containing a menu item as template.

Everything was fine until I realized, that I seemed to have no chance to differentiate between the new commands having all the same id, but different application defined data - changed via the MENUITEMINFO and the related functions Get/SetMenuItemInfo.

I changed the menus after their creation to send a WM_MENUCOMMAND message instead of a WM_COMMAND message by setting the dwStyle flag MNS_NOTIFYBYPOS inside the MENUINFO structure via a call to SetMenuInfo.

Now - finally to the problem and the question - why I never receive the WM_MENUCOMMAND message?

I patched CMainFrame::PreTranslateMessage method to catch the WM_MENUCOMMAND message, I tried with CMainFrame::WindowProc, and by registering a ON_MESSAGE handler inside the message map, but ... nothing worked!

Thanks for any reaction in advance!

Best regards,

Martin Lemburg
QuestionRe: Windows Menus and the WM_MENUCOMMAND message Pin
prasad_som16-Feb-07 1:51
prasad_som16-Feb-07 1:51 
AnswerRe: Windows Menus and the WM_MENUCOMMAND message Pin
Martin081516-Feb-07 2:22
professionalMartin081516-Feb-07 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.