Mathew
2006-02-02 10:33:00 UTC
Hi
I feel pretty stupid asking this but how do I customize an MDI Child
Frame title bar without side effects? I adding a
CChildFrame::OnUpdateFrameTitle and that looked good until I noticed I
was getting multiple active views. To check it wasn't something else I
had done I used a VS 2005 wizard to build a brand new MFC MDI
application, and added the following test code:
// Called to update the window title
void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
CMDIChildWnd::OnUpdateFrameTitle(bAddToTitle);
SetWindowText(_T("ABC"));
}
Sure enough, if I create multiple views, and switch between the windows
by clicking on them, I get into a situation where I have multiple active
window frames. If I comment out the SetWindowText line in the
OnUpdateFrameTitle above, I lose my custom window title but non-active
views have the correct inactive appearance. Actually, it's not the
whole window that incorrectly has the active appearance, it's just the
title bar. The rest of the window border has the inactive look.
I can send a picture to anyone who's interested.
What am I doing wrong?
Thanks in advance
Mathew
XP SP2 | VS 2005
I feel pretty stupid asking this but how do I customize an MDI Child
Frame title bar without side effects? I adding a
CChildFrame::OnUpdateFrameTitle and that looked good until I noticed I
was getting multiple active views. To check it wasn't something else I
had done I used a VS 2005 wizard to build a brand new MFC MDI
application, and added the following test code:
// Called to update the window title
void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
CMDIChildWnd::OnUpdateFrameTitle(bAddToTitle);
SetWindowText(_T("ABC"));
}
Sure enough, if I create multiple views, and switch between the windows
by clicking on them, I get into a situation where I have multiple active
window frames. If I comment out the SetWindowText line in the
OnUpdateFrameTitle above, I lose my custom window title but non-active
views have the correct inactive appearance. Actually, it's not the
whole window that incorrectly has the active appearance, it's just the
title bar. The rest of the window border has the inactive look.
I can send a picture to anyone who's interested.
What am I doing wrong?
Thanks in advance
Mathew
XP SP2 | VS 2005