1

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
SNC
  • 59
  • 2
  • 15
  • You can't change the menu border. There are other menu classes which are windows, but act like menus, and you can do anything with them. What IDE/version do you use? You might want to leave this alone actually and don't worry about borders. – Barmak Shemirani May 22 '15 at 02:00
  • There is a tool, a little old though, which you can use to change the looks and colors of windows, buttons, menues etc, www.appface.com. The separator color can definitely be changed, I am not sure about the border though. Give it a shot, it has a trial period. – gilgamash May 27 '15 at 06:49

1 Answers1

0

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);
SNC
  • 59
  • 2
  • 15
  • `MIM_APPLYTOSUBMENUS` must be part of `fMask`, not `dwStyle`. Also, this doesn't help to color separator/border. – Codeguard Feb 07 '19 at 13:02