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
Printable View
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
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.
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.
Code:AfxGetMainWnd()->SetWindowText("19 MAY 2005");
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):Quote:
Originally Posted by Geof
Code:cs.style &= ~FWS_ADDTOTITLE;
CMDIChildWnd isn't the class for the application's main window. It's the frame for each individual view.Quote:
Originally Posted by Geof