Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Title to View

Posted on 1999-07-27
2
Medium Priority
?
232 Views
Last Modified: 2013-11-20
In my application (MDI) ther are several views to one document each one of the views needs to have a different name.
The problem is that when I use SetWindowText to change the title it changes whenever I Open a new document.
If I use SetTitle() I can give only one title to all the views of the document.
0
Comment
Question by:Anonimus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
VCGuru earned 200 total points
ID: 1311603
I didn't get you question properly, You may reject this answer  if you have already done this

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
      
      cs.style&=~FWS_ADDTOTITLE;
      return CMDIChildWnd::PreCreateWindow(cs);
}

void CMyView::OnInitialUpdate()
{
      CMyView::OnInitialUpdate();
      GetParentFrame()->SetWindowText("testtitle");
}

0
 
LVL 12

Expert Comment

by:migel
ID: 1311604
Hi!
You  must override
void CMDIChildWnd::OnUpdateFrameTitle(BOOL bAddToTitle).
for example:
{
      // update our parent window first
      GetMDIFrame()->OnUpdateFrameTitle(bAddToTitle);

      if ((GetStyle() & FWS_ADDTOTITLE) == 0)
            return;     // leave child window alone!

      CDocument* pDocument = GetActiveDocument();
      if (bAddToTitle && pDocument != NULL)
      {
      //char szText[256];
      // here is your place to change text!
      SetWindowText(szText);
      }
}
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

688 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