1

I tried SetMenuInfo with MIM_BACKGROUND, but it doesn't work. I found it is because the Visual Style is enabled. But I don't want to disable the Visual Style by SetWindowTheme(hwndMain, L"", L"") becauuse it will change the appearance of the title bar and border...etc.

Is there any way to change, and only change the background color of the menu bar, without disalbe Visual Style of the main window. By "only change", I also mean that I don't have to draw the menu items myself, like I can use custom draw for change only the background color of toolbar, tab...etc. (But I can find custom draw for menu bar!).

4

2 回答 2

2

您只需将 MainMenu 的OwnerDrawProperty 设置为 true,Menu 会自动关闭 Menu 的主题,但不要关闭 Window 的主题!

于 2013-09-23T14:57:59.730 回答
0

With themes there is no official way to change the color. However you can take advantage of some undocumented window messages to implement the custom drawing yourself. https://github.com/adzm/win32-custom-menubar-aero-theme

于 2021-02-04T21:43:38.010 回答