Print Page | Close Window

How to change app title from Backstage

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23561
Printed Date: 17 December 2018 at 9:52am


Topic: How to change app title from Backstage
Posted By: olebed
Subject: How to change app title from Backstage
Date 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



Print Page | Close Window