Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to change app title from Backstage
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change app title from Backstage

 Post Reply Post Reply
Author
Message
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Topic: How to change app title from Backstage
    Posted: 04 February 2018 at 1:38pm
Hello,

There was question from customer, I think solution will be useful for other.

Problem was in that calling CDocument::SetTitle() from Backstage Pages don't have immediate results in titleBar of application.

Title belongs to Frame of application. CDocument::SetTitle call updating frames only of visible Views. CDocument belong to View which is invisible when shown Ribbon's Backstage. So title can't be updated by calling CDocument::SetTitle() when Backstage visible.

Workaround is that you need to pass pointer to your RibbonBar to BackstagePage and make next calls
m_pMyDoc->SetTitle(strTitle);
::DefWindowProc(m_pRibbonBar->GetSite()->GetSafeHwnd(), WM_SETTEXT, XTPToWPARAM(0), XTPToLPARAM((LPCTSTR)strTitle));
m_pRibbonBar->OnRecalcLayout();
m_pRibbonBar->Redraw();
Regards,
 Oleksandr Lebed
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.