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. Change Titletext of an SDI App at the very beginning

Change Titletext of an SDI App at the very beginning

Scheduled Pinned Locked Moved C / C++ / MFC
6 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.
  • U Offline
    U Offline
    User 1354
    wrote on last edited by
    #1

    I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you

    R J S 3 Replies Last reply
    0
    • U User 1354

      I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you

      R Offline
      R Offline
      Rizwan Majeed
      wrote on last edited by
      #2

      To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.

      U E 2 Replies Last reply
      0
      • R Rizwan Majeed

        To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.

        U Offline
        U Offline
        User 1354
        wrote on last edited by
        #3

        Wunderful Thank You

        1 Reply Last reply
        0
        • U User 1354

          I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you

          J Offline
          J Offline
          Jeff Naber
          wrote on last edited by
          #4

          Hi DiDi, I haven't done this myself, but I have done this with Dialog Based apps, so I am making some assumptions here. In your SDI, in the View class, there is a function OnInitialUpdate(). This function is called after the window is 'created' but before it is actually displayed on the screen. In order to set the window text, the window must exist. But, I understand that you want to set the text before the window becomes visible. The aforementioned function is the perfect place to put such code. In your View class, override OnInitialUpdate(), call the base class CView::OnInitialUpdate(), and then add your code to change the name of your window before this function finishes. Hope this helps Jeff

          1 Reply Last reply
          0
          • U User 1354

            I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you

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

            http://home.socal.rr.com/samhobbs/VC/ChangeTitle.html

            1 Reply Last reply
            0
            • R Rizwan Majeed

              To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.

              E Offline
              E Offline
              Erik Funkenbusch
              wrote on last edited by
              #6

              That's a little extreme. All you need do is remove the FWS_ADDTOTITLE style from the window and then change the IDR_MAINFAME string to say whatever you like.

              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