Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSet Icon Pin
MsmVc3-Dec-08 23:51
MsmVc3-Dec-08 23:51 
AnswerRe: Set Icon Pin
Code-o-mat4-Dec-08 0:15
Code-o-mat4-Dec-08 0:15 
GeneralRe: Set Icon Pin
MsmVc4-Dec-08 17:18
MsmVc4-Dec-08 17:18 
QuestionMenuBar and ToolBar background color Pin
karhong3-Dec-08 23:09
karhong3-Dec-08 23:09 
AnswerRe: MenuBar and ToolBar background color Pin
Code-o-mat4-Dec-08 0:38
Code-o-mat4-Dec-08 0:38 
GeneralRe: MenuBar and ToolBar background color Pin
karhong4-Dec-08 16:52
karhong4-Dec-08 16:52 
GeneralRe: MenuBar and ToolBar background color Pin
Code-o-mat4-Dec-08 21:59
Code-o-mat4-Dec-08 21:59 
AnswerRe: MenuBar and ToolBar background color Pin
karhong8-Dec-08 22:15
karhong8-Dec-08 22:15 
To change the background color of MenuBar, simply add below's line of code, 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);
}

As for Toolbar's background color, create OnNotify at MainFrame, put below's code

LPNMHDR pnmh = (LPNMHDR) lParam;
if(pnmh->hwndFrom == m_wndToolBar.m_hWnd)
{
LPNMTBCUSTOMDRAW lpNMCustomDraw = (LPNMTBCUSTOMDRAW) lParam;
CRect rect;
m_wndToolBar.GetClientRect(rect);
FillRect(lpNMCustomDraw->nmcd.hdc, rect, (HBRUSH)GetStockObject(GRAY_BRUSH));

}
return CFrameWnd::OnNotify(wParam, lParam, pResult);



Thanks for those who helped me. I'm giving out the solution i've got.

good

QuestionKnow architecture of remote host (32bit or 64bit) Pin
Roshan Nikam3-Dec-08 20:55
Roshan Nikam3-Dec-08 20:55 
AnswerRe: Know architecture of remote host (32bit or 64bit) Pin
KarstenK3-Dec-08 21:12
mveKarstenK3-Dec-08 21:12 
AnswerRe: Know architecture of remote host (32bit or 64bit) Pin
Cedric Moonen3-Dec-08 21:24
Cedric Moonen3-Dec-08 21:24 
GeneralRe: Know architecture of remote host (32bit or 64bit) Pin
Roshan Nikam3-Dec-08 21:47
Roshan Nikam3-Dec-08 21:47 
AnswerRe: Know architecture of remote host (32bit or 64bit) Pin
Iain Clarke, Warrior Programmer4-Dec-08 10:20
Iain Clarke, Warrior Programmer4-Dec-08 10:20 
Questionnot resonding /slow to response any click event Pin
anilaabc3-Dec-08 20:45
anilaabc3-Dec-08 20:45 
AnswerRe: not resonding /slow to response any click event Pin
Cedric Moonen3-Dec-08 20:58
Cedric Moonen3-Dec-08 20:58 
GeneralRe: not resonding /slow to response any click event Pin
anilaabc3-Dec-08 21:13
anilaabc3-Dec-08 21:13 
GeneralRe: not resonding /slow to response any click event Pin
Cedric Moonen3-Dec-08 21:22
Cedric Moonen3-Dec-08 21:22 
GeneralRe: not resonding /slow to response any click event Pin
anilaabc3-Dec-08 21:35
anilaabc3-Dec-08 21:35 
GeneralRe: not resonding /slow to response any click event [modified] Pin
Code-o-mat4-Dec-08 0:51
Code-o-mat4-Dec-08 0:51 
AnswerRe: not resonding /slow to response any click event Pin
KarstenK3-Dec-08 21:10
mveKarstenK3-Dec-08 21:10 
GeneralRe: not resonding /slow to response any click event Pin
anilaabc3-Dec-08 21:19
anilaabc3-Dec-08 21:19 
QuestionShow in Taskbar Pin
NewVC++3-Dec-08 20:45
NewVC++3-Dec-08 20:45 
AnswerRe: Show in Taskbar Pin
Nishad S3-Dec-08 21:29
Nishad S3-Dec-08 21:29 
AnswerRe: Show in Taskbar Pin
Code-o-mat3-Dec-08 21:32
Code-o-mat3-Dec-08 21:32 
QuestionNeed to execute an Exe when a service starts Pin
krishnan.s3-Dec-08 20:42
krishnan.s3-Dec-08 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.