Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want change the background color of the menubar in SDI(VC2008 , not sp1).my operation system is WIN7(64bits).? and i can not solve the problem by adding below's line of code at the beginning of mainframe OnCreate

C++
CBrush* NewBrush;
NewBrush = new CBrush;
NewBrush->CreateSolidBrush(RGB(139,137,137));

MENUINFO MenuInfo = {0};
MenuInfo.cbSize = sizeof(MenuInfo);
MenuInfo.hbrBack = *NewBrush; // Brush you want to draw
MenuInfo.fMask = MIM_BACKGROUND;
MenuInfo.dwStyle = MNS_AUTODISMISS;

CMenu* pMenu = this->GetMenu();

if(IsMenu(pMenu->m_hMenu))
{
SetMenuInfo(pMenu->m_hMenu, &MenuInfo);
}



please help me. thanks.
Posted
Updated 15-May-13 23:29pm
v2

1 solution

 
Share this answer
 
Comments
kangfr 16-May-13 9:24am    
thanks for your reply. the example can change the background color of menubar. but can not change the color on the right side of the menubar. Could you give me some ideas? thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900