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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get rid of "Untitled" in SDI app title bar?

How to get rid of "Untitled" in SDI app title bar?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
8 Posts 5 Posters 1 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.
  • I Offline
    I Offline
    Ian Bowler
    wrote on last edited by
    #1

    Hello, I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp". Any suggestions? Thanks! -Ian

    T C D O 4 Replies Last reply
    0
    • I Ian Bowler

      Hello, I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp". Any suggestions? Thanks! -Ian

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      go to the resource editor, then check the SDI frame properties and search the caption... you could also do it at run time with a little SetWindowText() on you main frame...


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      I 1 Reply Last reply
      0
      • I Ian Bowler

        Hello, I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp". Any suggestions? Thanks! -Ian

        C Offline
        C Offline
        ClockDivider
        wrote on last edited by
        #3

        Isn´t it just AfxGetMainWnd()->SetWindowText("MyApp")? Didn´t try, but it´s a suggestion... Greez! Martin...

        I 1 Reply Last reply
        0
        • T toxcct

          go to the resource editor, then check the SDI frame properties and search the caption... you could also do it at run time with a little SetWindowText() on you main frame...


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          I Offline
          I Offline
          Ian Bowler
          wrote on last edited by
          #4

          Right you are! And here I was thinking I'd have to override one of the CDocTemplate methods... I guess I over-thunk this one... lol... Thanks!

          T 1 Reply Last reply
          0
          • C ClockDivider

            Isn´t it just AfxGetMainWnd()->SetWindowText("MyApp")? Didn´t try, but it´s a suggestion... Greez! Martin...

            I Offline
            I Offline
            Ian Bowler
            wrote on last edited by
            #5

            D'oh! Yes, you are right! (I definately over-thought this one... ) Thanks alot!

            1 Reply Last reply
            0
            • I Ian Bowler

              Right you are! And here I was thinking I'd have to override one of the CDocTemplate methods... I guess I over-thunk this one... lol... Thanks!

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              Ian Bowler wrote:

              Thanks!

              you're welcome ! it's very nice to see you got rid of that problem thanks to my advise,, knowing that i never did this before !! :-D:-D (but, yeah, that's quite common task, so it was not too hard to imagine the solution for it ;) )


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              1 Reply Last reply
              0
              • I Ian Bowler

                Hello, I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp". Any suggestions? Thanks! -Ian

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

                Most folks use:

                BOOL CMainFrame::PreCreateWindow( CREATESTRUCT &cs )
                {
                cs.style &= ~FWS_ADDTOTITLE;
                return CFrameWnd::PreCreateWindow(cs);
                }


                "Take only what you need and leave the land as you found it." - Native American Proverb

                1 Reply Last reply
                0
                • I Ian Bowler

                  Hello, I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp". Any suggestions? Thanks! -Ian

                  O Offline
                  O Offline
                  Owner drawn
                  wrote on last edited by
                  #8

                  Ian Bowler wrote:

                  "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp".

                  CDocument *doc; //get your document
                  doc.SetTitle("Any title can be given here");

                  Hope this will do. :)

                  --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

                  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