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. the title of the window

the title of the window

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
7 Posts 6 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.
  • G Offline
    G Offline
    gucy
    wrote on last edited by
    #1

    i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is "untitled:1-MyProject" Now i ask how to remove the sign ":"? gucy

    S S D 3 Replies Last reply
    0
    • G gucy

      i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is "untitled:1-MyProject" Now i ask how to remove the sign ":"? gucy

      S Offline
      S Offline
      Stlan
      wrote on last edited by
      #2

      You need to override the SetTitle() function member of your CDocument-derived object.

      A 1 Reply Last reply
      0
      • G gucy

        i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is "untitled:1-MyProject" Now i ask how to remove the sign ":"? gucy

        S Offline
        S Offline
        sulaxan
        wrote on last edited by
        #3

        hello...... u can set the title of the application window in InitInstance() function of the SDI application class.... u'll have m_pMainWnd as member variable... all u've to do is m_pMainWnd->SetWindowText("MyProject"); or go to string table and change IDS_APP_TITLE Caption to Myproject...... try the first one...which is better Adi

        1 Reply Last reply
        0
        • S Stlan

          You need to override the SetTitle() function member of your CDocument-derived object.

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          i did so,but the string ":1" is still there

          1 Reply Last reply
          0
          • G gucy

            i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is "untitled:1-MyProject" Now i ask how to remove the sign ":"? gucy

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            This is strange, as a default SDI, or even an MDI, application would have a caption of Untitled - MyProject. It sounds like you've changed something to get the additional ":1" in the caption. Now to get rid of the "Untitled - " part of the caption, simply add the following to your CMainFrame::PreCreateWindow() function: cs.style &= ~FWS_ADDTOTITLE;

            B 1 Reply Last reply
            0
            • D David Crow

              This is strange, as a default SDI, or even an MDI, application would have a caption of Untitled - MyProject. It sounds like you've changed something to get the additional ":1" in the caption. Now to get rid of the "Untitled - " part of the caption, simply add the following to your CMainFrame::PreCreateWindow() function: cs.style &= ~FWS_ADDTOTITLE;

              B Offline
              B Offline
              basementman
              wrote on last edited by
              #6

              The :1 indicates the view number of of the document is open in the current session (MDI-related). For more details, look at the MFC source code file WINFRM.CPP, function void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName) onwards and upwards...

              D 1 Reply Last reply
              0
              • B basementman

                The :1 indicates the view number of of the document is open in the current session (MDI-related). For more details, look at the MFC source code file WINFRM.CPP, function void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName) onwards and upwards...

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                I knew I'd seen the :1 before but since I've probably only written 3 MDI apps since they were introduced, I couldn't pull it from memory. Even so, I've not ever needed to open two of the same window! Most of what I do revolves around dialog boxes, and SDI apps, or no UI at all.

                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