本文介绍了如何在SDI中更改菜单栏的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在SDI(VC2008,而不是sp1)中更改菜单栏的背景颜色。我的操作系统是WIN7(64位)。我无法通过在大型机OnCreate的开头添加以下代码行来解决问题
CBrush * NewBrush;
NewBrush = new CBrush;
NewBrush-> CreateSolidBrush(RGB( 139 , 137 , 137 跨度>));
MENUINFO MenuInfo = { 0 };
MenuInfo.cbSize = sizeof (MenuInfo);
MenuInfo.hbrBack = * NewBrush; // 您要绘制的画笔
MenuInfo.fMask = MIM_BACKGROUND;
MenuInfo.dwStyle = MNS_AUTODISMISS;
CMenu * pMenu = 此 - > GetMenu();
if (IsMenu(pMenu-> m_hMenu))
{
SetMenuInfo(pMenu-> m_hMenu, &安培; MenuInfo);
}
请帮帮我。谢谢。
解决方案
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
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.
解决方案
这篇关于如何在SDI中更改菜单栏的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!