-
December 6th, 2004, 10:25 PM
#1
Change window name
I would like to change the default name that appear at the the to of the window in a MDI application. I tried to use the function SetWindowText, it run but never change. I call it in the OnInitUpdate function of the window.
Thanks
-
December 7th, 2004, 12:05 AM
#2
Re: Change window name
SetWindowText is the function which would do it. Make sure you're giving it the correct HWND. Or calling it in the applications init rather than one of the mdi child windows.
-
December 13th, 2004, 11:30 PM
#3
Re: Change window name
I call it directly in the OnCreate function of my window ( CMDIChildWnd). At the same place I call MoveWindow to resize it and it work.
-
December 14th, 2004, 03:34 AM
#4
Re: Change window name
Code:
AfxGetMainWnd()->SetWindowText("19 MAY 2005");
-
December 15th, 2004, 08:18 AM
#5
Re: Change window name
Is it work with the title of a MDI Frame?
-
December 15th, 2004, 08:30 AM
#6
Re: Change window name
Originally Posted by Geof
Is it work with the title of a MDI Frame?
No, since the MFC framework adds its own mechanism to automatically display the current document name in the MDI frame's caption. To turn off that feature, you'll have to add the following line to the main frame's PreCreateWindow() (before calling the base class implementation):
Code:
cs.style &= ~FWS_ADDTOTITLE;
-
December 15th, 2004, 08:35 AM
#7
Re: Change window name
Originally Posted by Geof
I call it directly in the OnCreate function of my window ( CMDIChildWnd). At the same place I call MoveWindow to resize it and it work.
CMDIChildWnd isn't the class for the application's main window. It's the frame for each individual view.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|