Link to home
Start Free TrialLog in
Avatar of mpwells
mpwells

asked on

MDI Child Frame titlebar text in MainFrame titlebar

I am writing a MDI application using Visual C++ 6.0 under Windows 98 SE. The application has a few child frames under the main frame. In the CMainFrame::PreCreateWindow function, I set the CREATESTRUCT to include 'cs.style &= ~FWS_ADDTOTITLE' to remove the filenames from the MainFrame titlebar text.

When I maximize any of the child frames, the text of the child frame titlebar is added to the MainFrame titlebar text (ie App [child frame titlebar text]).

I would like to prevent the changing of the MainFrame titlebar text in the situation. I would perfer not to just call SetWindowText in the MainFrame after the maximize. I would like to be able to override some functionality to pervent the MainFrame titlebar text from changing.

Any help would be appreciated.

Thanks,

Mike
Avatar of RONSLOW
RONSLOW

Override UpdateFrameTitle and call SetWindowText (or AfxSetWindowText) to change the title.

Alternatively, call AfxSetWindowText in you OnIdle processing (AfxSetWindowText doesn't repaint the title unless it is different and so avoids flicker).


You may need to override
LRESULT CMainFrame::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM)
and do a
  m_nIdleFlags |= idleTitle;
before calling the base class

Avatar of mpwells

ASKER

I tried all of the suggestions you had. I even put breakpoints in these functions and they are not being called when the child frame is created and maximized.

Thank you for your help.
Hi!
do you try remove FWS_ADDTOTITLE in the your CMDIFrameWnd derived class (CMainFrame)?
PreCreateWindow is the best place to do this.
I'll give it a try and see what happens.

migel: he said he did that already?
ASKER CERTIFIED SOLUTION
Avatar of migel
migel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mpwells

ASKER

It's a longer story tan you probably care to hear, but I was able to verify that your fix indeed works by putting the SetWindowText in the OnUpdateFrameTitle function. The problem I thought I would have with the flicker did not happend.

Thank you for your help.
But you awarded the points to migel and not to me !!

Perhaps you got confused about who you were awarding to?
Avatar of mpwells

ASKER

I noticed that shortly after I did it and could not undo it. I contacted Experts Exchange and they told me that they would be giving you the 100 points. If this does not happen then please let me know by making a comment to this question and I will be happy to post a "question" so that I may give you the points due to you.

Thanks and sorry,
Mike
Thanks .. got the points.

Don't worry, It happens to the bets of us :-)
ooo
I feel so stupid
sorry :-(