?
Solved

HOWTO change titlebar from a SDI application?

Posted on 2001-06-25
3
Medium Priority
?
911 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 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