I'm wondering how I can set the size of an ownerdraw CMenu using his own text.
Looking at the documentation:
void CColorMenu::MeasureItem(LPMEASUREITEMSTRUCT lpMIS)
{
// all items are of fixed size
lpMIS->itemWidth = COLOR_BOX_WIDTH;
lpMIS->itemHeight = COLOR_BOX_HEIGHT;
}
But using this approach I have the same size for all the menus. How I can have dynamic dimension of the menu and submenu as for the standard windows menu?
You have to identity the item you want to draw by the given information in the MEASUREITEMSTRUCT. Just read the docs ind the MSDN.
You receive this message for each item in the menu.