SNC
SNC

Reputation: 59

CMenu border color on MFC

I've a class that inherit from CMenu Owner draw menu

using this class the Menu appears correctly but, for example, when you open the menu FILE you will see the border and the separator of the standard menu color

How I can paint also this part of the desired color?

below an image, you can see the submenu of files with selected colors (green) and the standard windows menu gray on the borders/spacers

enter image description here

Upvotes: 1

Views: 2268

Answers (1)

SNC
SNC

Reputation: 59

Using the menu example this is possible with these lines of code inside "AddSubMenus" function

MENUINFO MenuInfo = { 0 };
MenuInfo.cbSize = sizeof(MENUINFO);
GetMenuInfo(&MenuInfo);
MenuInfo.hbrBack = ::CreateSolidBrush(RGB(0, 0, 0));
MenuInfo.fMask = MIM_BACKGROUND | MIM_STYLE;
MenuInfo.dwStyle = MIM_APPLYTOSUBMENUS;
SetMenuInfo(&MenuInfo);
tmpmenu.SetMenuInfo(&MenuInfo);

Upvotes: 0

Related Questions