Solved

MDI Child Frame titlebar text in MainFrame titlebar

Posted on 2000-02-24
11
534 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:mpwells
  • 5
  • 3
  • 3
11 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2556299
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).


0
 
LVL 10

Expert Comment

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

0
 

Author Comment

by:mpwells
ID: 2558064
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.
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 12

Expert Comment

by:migel
ID: 2558826
Hi!
do you try remove FWS_ADDTOTITLE in the your CMDIFrameWnd derived class (CMainFrame)?
PreCreateWindow is the best place to do this.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2560339
I'll give it a try and see what happens.

migel: he said he did that already?
0
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 2563982
RONSLOW: yes I did it.
0
 

Author Comment

by:mpwells
ID: 2564973
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.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2566981
But you awarded the points to migel and not to me !!

Perhaps you got confused about who you were awarding to?
0
 

Author Comment

by:mpwells
ID: 2568845
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
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2570711
Thanks .. got the points.

Don't worry, It happens to the bets of us :-)
0
 
LVL 12

Expert Comment

by:migel
ID: 2571715
ooo
I feel so stupid
sorry :-(
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 121
Doc'in system (example?) BA 7 110
abstract class with all non abstract mentods 6 76
EvenOdd challenge 10 108
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question