Hi !
Situation:
I created a self-drawn menu. My class it's called GMenu (derivated from CMenu).
The first item in the menu is a popup item.
In OnInitDialog I called ModifyMenu for setting the handle to the popup menu that would appear if user clicks the popup item, like this:
(hMenu is a handle to a loaded menu)Code:ModifyMenu( 0, MF_BYPOSITION | MF_POPUP | MF_OWNERDRAW, (UINT_PTR)hMenu, (LPCTSTR)data );
Problem:
GMenu::MeasureItem it's called for all items except this popup item. In output window I get the warning:
What I already knowCode:Warning: unknown WM_MEASUREITEM for menu item 0x4160665
I suppose the MFC is unable to transform this message to a function call.
Menu isn't displayed correctly because the size of menu item is not known by MFC.
Question
Where could be my mistake? How can I convince MFC to call MeasureItem for this popup item?
Thanks for your help.




Reply With Quote