?
Solved

HOWTO change titlebar from a SDI application?

Posted on 2001-06-25
3
Medium Priority
?
914 Views
Last Modified: 2013-11-20
Hello!

HOWTO can I the change titlebar from my SDI MFC application?
Currently it is doc/view with default title:
"filename - appname"
I want to change to:
"appname - filename"

thanks!
0
Comment
Question by:jussara
[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
3 Comments
 
LVL 12

Accepted Solution

by:
migel earned 150 total points
ID: 6224804
Hi!
override in the your CMainFrame:
virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
code can be like this:

{
     // copy first part of title loaded at time of frame creation
     TCHAR szText[256+_MAX_PATH] ;
     *szText = 0;

     CDocument* pDocument = GetActiveDocument();
     if (bAddToTitle && pDocument != NULL)
          {
           lstrcpy(szText, pDocument->GetTitle());
          lstrcat(szText, _T(" - "));
          }
     lstrcat(szText, m_strTitle);
     AfxSetWindowText(m_hWnd, szText);
}
0
 

Expert Comment

by:shambhu_421
ID: 6243860
hi,
you question seams to be interesting . could you kindly explain your question in detail.

thanks,
sham.
0
 

Author Comment

by:jussara
ID: 6260716
I must change AfxSetWindowText(m_hWnd, szText);
to
SetWindowText(szText);
to work well.

Thanks
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 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