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. Application Title in MDI Application

Application Title in MDI Application

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 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.
  • E Offline
    E Offline
    eusto
    wrote on last edited by
    #1

    From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?

    N R 2 Replies Last reply
    0
    • E eusto

      From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      eusto wrote:

      the mainframe title is stored in the string table.

      CDocument::SetTitle. Read the docs too.


      Nibu thomas A Developer Programming tips[^]  My site[^]

      E 1 Reply Last reply
      0
      • N Nibu babu thomas

        eusto wrote:

        the mainframe title is stored in the string table.

        CDocument::SetTitle. Read the docs too.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        E Offline
        E Offline
        eusto
        wrote on last edited by
        #3

        I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

        N D realJSOPR 3 Replies Last reply
        0
        • E eusto

          I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          eusto wrote:

          I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

          That's how it's to be done in DV architecture. If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function. You would like to look up FWS_ADDTOTITLE and FWS_PREFIXTITLE.


          Nibu thomas A Developer Programming tips[^]  My site[^]

          P 1 Reply Last reply
          0
          • N Nibu babu thomas

            eusto wrote:

            I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

            That's how it's to be done in DV architecture. If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function. You would like to look up FWS_ADDTOTITLE and FWS_PREFIXTITLE.


            Nibu thomas A Developer Programming tips[^]  My site[^]

            P Offline
            P Offline
            prasad_som
            wrote on last edited by
            #5

            Nibu babu thomas wrote:

            If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function.

            If its not virtual, how different behaviour can be forced ?

            Prasad Notifier using ATL | Operator new[],delete[][^]

            1 Reply Last reply
            0
            • E eusto

              I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

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

              eusto wrote:

              I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

              One line of code is too much. :confused: How so?


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "Judge not by the eye but by the heart." - Native American Proverb

              1 Reply Last reply
              0
              • E eusto

                From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?

                R Offline
                R Offline
                Ravi Bhavnani
                wrote on last edited by
                #7

                Override CFrameWnd::OnUpdateFrameTitle(). The application framework calls this method whenever it needs to update the frame's caption. On-demand updating is preferred to setting a modified title. (Why? Because it reduces the chance of programmer error and centralizes the title logic to a single location.) /ravi

                This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

                1 Reply Last reply
                0
                • E eusto

                  I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  AfxGetMainWnd()->SetWindowText("My Title");

                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  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