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 MainFrame Title at runtime

Changing MainFrame Title at runtime

Scheduled Pinned Locked Moved C / C++ / MFC
9 Posts 5 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.
  • M Offline
    M Offline
    Mr Bose Dayala
    wrote on last edited by
    #1

    Hi, I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent. thanks in advace rgds Thomas ThomasKennedyBose

    H N A M 4 Replies Last reply
    0
    • M Mr Bose Dayala

      Hi, I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent. thanks in advace rgds Thomas ThomasKennedyBose

      H Offline
      H Offline
      HENDRIK R
      wrote on last edited by
      #2

      As far as I know you can't set a title for the whole runtime. But you could try to handle WM_SETTEXT and there don't let it set your caption. If this doesn't work you should set your title even when a window get's closed.

      M 1 Reply Last reply
      0
      • M Mr Bose Dayala

        Hi, I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent. thanks in advace rgds Thomas ThomasKennedyBose

        N Offline
        N Offline
        Nitron
        wrote on last edited by
        #3

        Will YourMainframe.SetWindowText("Test") not work? - Nitron


        "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

        H M 2 Replies Last reply
        0
        • N Nitron

          Will YourMainframe.SetWindowText("Test") not work? - Nitron


          "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

          H Offline
          H Offline
          HENDRIK R
          wrote on last edited by
          #4

          Perhaps you read over it, but he mentioned that the title of his mainframe is set back after closing a view. Thus his problem should not be a problem of SetWindowText.

          1 Reply Last reply
          0
          • M Mr Bose Dayala

            Hi, I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent. thanks in advace rgds Thomas ThomasKennedyBose

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

            What about setting the document title by GetDocument ()->SetTitle). Also, try changing the application title in the string table

            M 1 Reply Last reply
            0
            • M Mr Bose Dayala

              Hi, I'm changing my MainFrame's Title when I open a new view.But when I close this view Title is setting back to previous like when my application was opened for the first time.can anybody give me the suggetion to change the Title which does not changes even any view is opened or closed.this is very urgent. thanks in advace rgds Thomas ThomasKennedyBose

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              If you mean you don't want to have the current document's filename in the title, then in CMainFrame::PreCreateWindow(), turn off the FWS_ADDTOTITLE style. --Mike-- I'm bored... Episode I bored. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

              1 Reply Last reply
              0
              • H HENDRIK R

                As far as I know you can't set a title for the whole runtime. But you could try to handle WM_SETTEXT and there don't let it set your caption. If this doesn't work you should set your title even when a window get's closed.

                M Offline
                M Offline
                Mr Bose Dayala
                wrote on last edited by
                #7

                Ya.............u r right......v have to set the caption even the new window gets closed.Thanks a lot. ThomasKennedyBose

                1 Reply Last reply
                0
                • N Nitron

                  Will YourMainframe.SetWindowText("Test") not work? - Nitron


                  "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

                  M Offline
                  M Offline
                  Mr Bose Dayala
                  wrote on last edited by
                  #8

                  it will work but it won't remain even when the window gets closed ThomasKennedyBose

                  1 Reply Last reply
                  0
                  • A Anonymous

                    What about setting the document title by GetDocument ()->SetTitle). Also, try changing the application title in the string table

                    M Offline
                    M Offline
                    Mr Bose Dayala
                    wrote on last edited by
                    #9

                    it will work but it won't remain even when the window gets closed ThomasKennedyBose

                    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