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: 21 November 2024 at 4:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


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

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net