Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. *** Changing Title of a Document Frame ****

*** Changing Title of a Document Frame ****

Scheduled Pinned Locked Moved C / C++ / MFC
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steve Lai
    wrote on last edited by
    #1

    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

    M S 2 Replies Last reply
    0
    • S Steve Lai

      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

      M Offline
      M Offline
      Member 1208965
      wrote on last edited by
      #2

      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...

      S 1 Reply Last reply
      0
      • M Member 1208965

        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...

        S Offline
        S Offline
        Sam Hobbs
        wrote on last edited by
        #3

        The FAQ is available at: http://msdn.microsoft.com/library/backgrnd/html/msdn\_mfcfaq50.htm

        M 1 Reply Last reply
        0
        • S Steve Lai

          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

          S Offline
          S Offline
          Sam Hobbs
          wrote on last edited by
          #4

          The document name can be changed using CDocument::SetTitle. Also see: http://support.microsoft.com/support/kb/articles/q129/0/95.asp

          1 Reply Last reply
          0
          • S Sam Hobbs

            The FAQ is available at: http://msdn.microsoft.com/library/backgrnd/html/msdn\_mfcfaq50.htm

            M Offline
            M Offline
            Member 1208965
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups