*** Changing Title of a Document Frame ****
-
Hi everyone, I'm just wondering how you change the "Untitled" text found on the top left of a single document frame. If anyone knows, plmk. Thanks in advance! Steve
Steve, I'm not sure if you are asking how to change it to something else, or remove it. I'm assuming that you know that it says "Untitled" until the initial document is named while saving. This snippet below tells you how to remove the filename (or 'Untitled') from the Window title I dug this up from an old copy of the MFC FAQ I had kicking around: Override the PreCreateWindow() function in your MainFrame class and do the following in it.. cs.style &= ~FWS_ADDTOTITLE ; You can also set the initial window position (cs.x, cs.y, cs.cx, cs.cy) this way and change your class (cs.lpszClass) this way! Remember to call CFrameWnd::PreCreateWindow at the end...
-
Steve, I'm not sure if you are asking how to change it to something else, or remove it. I'm assuming that you know that it says "Untitled" until the initial document is named while saving. This snippet below tells you how to remove the filename (or 'Untitled') from the Window title I dug this up from an old copy of the MFC FAQ I had kicking around: Override the PreCreateWindow() function in your MainFrame class and do the following in it.. cs.style &= ~FWS_ADDTOTITLE ; You can also set the initial window position (cs.x, cs.y, cs.cx, cs.cy) this way and change your class (cs.lpszClass) this way! Remember to call CFrameWnd::PreCreateWindow at the end...
The FAQ is available at: http://msdn.microsoft.com/library/backgrnd/html/msdn\_mfcfaq50.htm
-
Hi everyone, I'm just wondering how you change the "Untitled" text found on the top left of a single document frame. If anyone knows, plmk. Thanks in advance! Steve
The document name can be changed using CDocument::SetTitle. Also see: http://support.microsoft.com/support/kb/articles/q129/0/95.asp
-
The FAQ is available at: http://msdn.microsoft.com/library/backgrnd/html/msdn\_mfcfaq50.htm
Sam, thanks. I tried the link at www.stingray.com/mfc_faq but it seemed to be broken, I'm happy to find this again in the MSDN.