Solved

Control of an MDI app title bar

Posted on 1998-04-06
2
256 Views
Last Modified: 2013-11-20
I'd like to manage the contents of my MDI app's title bar; I use SetWindowText to change it, however, as soon as I focus on another child window, the framework changes the titlebar back to the default app Name.  I know I need to override a message, and I've tried, Set & KillFocus, EraseBkgd, and Paint, to no avail.  How can I either a) prevent MFC from tampering with my app's title bar all together, or b) override the tampering to change to the text that I would like?  The text is dynamic and changes with the state of the program.
0
Comment
Question by:krw
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 20 total points
Comment Utility
Name of the document is added to frame window title id frame has style FWS_ADDTOTITLE. This is MFC style. To remove it override frame's PreCreateWindow and delete it.

BOOL CMainFrame::PreCreateWindow( CREATESTRUCT& cs )
{
cs.style &=~FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow( cs );
}
0
 

Author Comment

by:krw
Comment Utility
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now