Link to home
Start Free TrialLog in
Avatar of Anonimus
Anonimus

asked on

Title to View

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.
ASKER CERTIFIED SOLUTION
Avatar of VCGuru
VCGuru

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 migel
migel

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);
      }
}