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. Add text to title bar (or document header)

Add text to title bar (or document header)

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studioquestion
5 Posts 2 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.
  • A Offline
    A Offline
    AeJai
    wrote on last edited by
    #1

    How do you add text to the title bar of an application using Microsoft Visual Studio 2003 .NET Visual C++?

    M 1 Reply Last reply
    0
    • A AeJai

      How do you add text to the title bar of an application using Microsoft Visual Studio 2003 .NET Visual C++?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      SetWindowText() or WM_SETTEXT. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      A 2 Replies Last reply
      0
      • M Mark Salsbery

        SetWindowText() or WM_SETTEXT. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        AeJai
        wrote on last edited by
        #3

        Thanks. I will try it.

        1 Reply Last reply
        0
        • M Mark Salsbery

          SetWindowText() or WM_SETTEXT. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

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

          This application has a mainframe window and like an older version of Microsoft Word documents, it can have multiple files open (MDI). If you tile the windows, the active window's file name title shows in the mainframe's. The format the header or title bar has is as follows: [Application Name] - [Filename.extension] I want to modify it like this: [Application Name] - [Filename.extension] - [My Text Added Here] The problem is I do not have a handle to this section such as SetTitle() or SetName() and I am thinking I need to add a section to have such a handle. However, this is dealing with MFC.

          M 1 Reply Last reply
          0
          • A AeJai

            This application has a mainframe window and like an older version of Microsoft Word documents, it can have multiple files open (MDI). If you tile the windows, the active window's file name title shows in the mainframe's. The format the header or title bar has is as follows: [Application Name] - [Filename.extension] I want to modify it like this: [Application Name] - [Filename.extension] - [My Text Added Here] The problem is I do not have a handle to this section such as SetTitle() or SetName() and I am thinking I need to add a section to have such a handle. However, this is dealing with MFC.

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            GetWindowTextLength()/GetWindowText() or W<_GETTEXT/WM_GETTEXTLENGTH can be used to get the current title. Append your new text and set the new text. For MFC you can use something like CString titlestr; MainWnd->GetWindowText(titlestr); titlestr += _T(" - [My Text Added Here]"); MainWnd->SetWindowText(titlestr); Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            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