MDI Application How to change Views Title
-
Hi, step by step I am creating a Visual Studio Style IDE Project, but I am running in a bunch of problems. My application is MDI based, created in Visual Studio Style with Project Wizard. Further I added functionality for viewing different views for each document. For this views I need to set an application specific Windows title. Actually I found hints how to solve:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(LONG) FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
...CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();
GetParent()->SetWindowsText(_T("myText"));But it works only partially. The default view's title disappears, but my own one is not displayed. The title in the tab header is empty after the changes. Maybe it is because my view is a splitter view or the ChildFrame is with a Tab Control. I have no idea, how to solve. Anybody, who has an idea? Many Thanks!
-
Hi, step by step I am creating a Visual Studio Style IDE Project, but I am running in a bunch of problems. My application is MDI based, created in Visual Studio Style with Project Wizard. Further I added functionality for viewing different views for each document. For this views I need to set an application specific Windows title. Actually I found hints how to solve:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(LONG) FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
...CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();
GetParent()->SetWindowsText(_T("myText"));But it works only partially. The default view's title disappears, but my own one is not displayed. The title in the tab header is empty after the changes. Maybe it is because my view is a splitter view or the ChildFrame is with a Tab Control. I have no idea, how to solve. Anybody, who has an idea? Many Thanks!
Member 8534035 wrote:
GetParent()->SetWindowsText(_T("myText"));
Does this even compile? Have you seen this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Member 8534035 wrote:
GetParent()->SetWindowsText(_T("myText"));
Does this even compile? Have you seen this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
uups...sorry...the source code I have written manually on the post, because my development environment is on another computer. but in principal it is according to what I have programmed
-
Member 8534035 wrote:
GetParent()->SetWindowsText(_T("myText"));
Does this even compile? Have you seen this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
oh...many thanks for the link! finally it works now! according to the link I override:
void CMainFrame::OnUpdateFrameTitle( BOOL bAddToTitle )
but this is affecting the application main title. but overriding
void CChildFrame::OnUpdateFrameTitle( BOOL bAddToTitle )
does exactely what I need! many thanks for your help! I searched already at least 2 hours for a solution!