[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

Control of an MDI app title bar

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
krw
Asked:
krw
1 Solution
 
galkinCommented:
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
 
krwAuthor Commented:
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now