really having trouble changing MDI window title 
Author Message
 really having trouble changing MDI window title

I am using chkbook example from the MSDN CD as a template
for my project.  I have two document templates that call
for two different view types for the same document. The
views are activated my menu items, and they appear with a
default title "Maestro1:1" "Maestro1:2" ect. (I only have
two views so far)  The 1 and 2 must indicate the 1st view
associated with the document, and 2nd view.  I want to
title the "Track View" and "Setting View".  I've tried
calling SetWindowText() in OnShowWindow in my MaestroView
class I've tried it in OnInitialUpdate().  I've gone into
CMainFrame which has a CreateOrActivateFrame() function and
I do pNewFrame->SetTitle("this is a test")  but nothing
seems to change what is displayed as the window title.

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Fri, 25 Jan 2002 03:00:00 GMT  
 really having trouble changing MDI window title
     This is an update.  I got the second views title to
change by calling SetWindowText() after InitialUpdateFrame
() in the CreateOrActivateFrame() function.  This is good
since this function creates all my views except the first
one.  I still haven't figured out where my first view is
being created, I'm new to this MDI concept.  Anyway, any
help would be appreciated.  I'll keep wrestling with it.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Fri, 25 Jan 2002 03:00:00 GMT  
 really having trouble changing MDI window title
Hello,

You might be interested to know that your problem is addressed in FAQ 3.20
of "The MFC Answer Book": How do I customize the captions of my views? You
can find screen shots and a sample program at <http://www.mfcfaq.com>.

The gist of the technique is to override the OnUpdateFrameTitle() function
in your CChildFrame class:

void CChildFrame::OnUpdateFrameTitle( BOOL bAddToTitle )
{
    CMDIChildWnd::OnUpdateFrameTitle( bAddToTitle );

    // Here, do what you want, for example:
    CString strInitialTitle;
    GetWindowText( strInitialTitle );

    CString strNewTitle;
    // ... build strNewTitle ...
    SetWindowText( strNewTitle );

Quote:
}

Find more than 130 similar and advanced tips and techniques in "The MFC
Answer Book: Solutions for Effective Visual C++ Applications". For
additional details, surf to <http://www.mfcfaq.com>.

Good luck!

- Eugene Kain
Author of "The MFC Answer Book: Solutions for Effective Visual C++
Applications" (Addison-Wesley, 1998).
Visit the book's web site at <http://www.mfcfaq.com>
Get information, reviews and best prices at
<http://www.amazon.com/exec/obidos/ASIN/0201185377/mfcfaqcom>


Quote:
> I am using chkbook example from the MSDN CD as a template
> for my project.  I have two document templates that call
> for two different view types for the same document. The
> views are activated my menu items, and they appear with a
> default title "Maestro1:1" "Maestro1:2" ect. (I only have
> two views so far)  The 1 and 2 must indicate the 1st view
> associated with the document, and 2nd view.  I want to
> title the "Track View" and "Setting View".  I've tried
> calling SetWindowText() in OnShowWindow in my MaestroView
> class I've tried it in OnInitialUpdate().  I've gone into
> CMainFrame which has a CreateOrActivateFrame() function and
> I do pNewFrame->SetTitle("this is a test")  but nothing
> seems to change what is displayed as the window title.

> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!



Sat, 26 Jan 2002 03:00:00 GMT  
 really having trouble changing MDI window title
I appreciate the responses.  I did finally figure the thing
out.  It turns out that the style bit FWS_ADDTOTITLE must
be set to zero in order to control the window title with
any of the member functions such as SetWindowTitle() or
SetTitle() , This is the case with an MDI application.  I
was under the impression that the style bit would just add
the document title and I could use SetWindowTitle() to
append my view description.  Not so, apparently, I needed
to construct my title by getting the document name and
appending the view name.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Sat, 26 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. beginners trouble with syntax for MDI window title

2. really having trouble with linked lists

3. Child windows from an MDI - Title changing

4. Change title of Child window in MDI app

5. Dynamically changing main window title bar for an MDI app

6. Change MDI Child Window TItle in OnOpenDocument

7. window titles of child windows in MDI

8. How to change TITLE of MDI-Child ???

9. Change MDI view title....

10. Change MDI Child title

11. How to change MDI doc title at runtime ?

12. How to change Title of an MDI-Child ???

 

 
Powered by phpBB® Forum Software