Solved

HOWTO change titlebar from a SDI application?

Posted on 2001-06-25
3
872 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now