Solved

HOWTO change titlebar from a SDI application?

Posted on 2001-06-25
3
889 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
3 Comments
 
LVL 12

Accepted Solution

by:
migel earned 50 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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