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#
  4. Changing the Text of a Window Title

Changing the Text of a Window Title

Scheduled Pinned Locked Moved C#
question
10 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.
  • T Offline
    T Offline
    That Asian Guy
    wrote on last edited by
    #1

    How do I change the text of a window? I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results. Thanks in advance.

    G 1 Reply Last reply
    0
    • T That Asian Guy

      How do I change the text of a window? I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results. Thanks in advance.

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      You can use SetWindowText Function[^] You will need some P/Invoke to get it working, I'm sure www.pinvoke.net has some examples.

      That Asian Guy wrote:

      I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results.

      Yes, the class I used in that application has read only properties. You can however extend it for your needs.

      Giorgi Dalakishvili #region signature my articles #endregion

      T 2 Replies Last reply
      0
      • G Giorgi Dalakishvili

        You can use SetWindowText Function[^] You will need some P/Invoke to get it working, I'm sure www.pinvoke.net has some examples.

        That Asian Guy wrote:

        I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results.

        Yes, the class I used in that application has read only properties. You can however extend it for your needs.

        Giorgi Dalakishvili #region signature my articles #endregion

        T Offline
        T Offline
        That Asian Guy
        wrote on last edited by
        #3

        Thanks, is there a way to change the icon as well?

        G 1 Reply Last reply
        0
        • T That Asian Guy

          Thanks, is there a way to change the icon as well?

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          I'm not aware of a function that changes icon of window

          Giorgi Dalakishvili #region signature my articles #endregion

          1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            You can use SetWindowText Function[^] You will need some P/Invoke to get it working, I'm sure www.pinvoke.net has some examples.

            That Asian Guy wrote:

            I read the article regarding Window Tabifier and tried using the code. However, this produced read-only results.

            Yes, the class I used in that application has read only properties. You can however extend it for your needs.

            Giorgi Dalakishvili #region signature my articles #endregion

            T Offline
            T Offline
            That Asian Guy
            wrote on last edited by
            #5

            Thanks, I went on pinvoke.net, but what should I set as the value of IntPtr? Thanks.

            G 1 Reply Last reply
            0
            • T That Asian Guy

              Thanks, I went on pinvoke.net, but what should I set as the value of IntPtr? Thanks.

              G Offline
              G Offline
              Giorgi Dalakishvili
              wrote on last edited by
              #6

              You should pass handle of the window for which you want to change text.

              Giorgi Dalakishvili #region signature my articles #endregion

              T 1 Reply Last reply
              0
              • G Giorgi Dalakishvili

                You should pass handle of the window for which you want to change text.

                Giorgi Dalakishvili #region signature my articles #endregion

                T Offline
                T Offline
                That Asian Guy
                wrote on last edited by
                #7

                Thanks, but how do I obtain this value?

                G 1 Reply Last reply
                0
                • T That Asian Guy

                  Thanks, but how do I obtain this value?

                  G Offline
                  G Offline
                  Giorgi Dalakishvili
                  wrote on last edited by
                  #8

                  You can use FindWindow Function[^] to find handle of the window if you know its current title. You can also use GetForegroundWindow Function[^] to find handle of foreground window or you can call EnumWindows Function[^] to enumerate all open windows. Which window do you want to change text for?

                  Giorgi Dalakishvili #region signature my articles #endregion

                  modified on Sunday, June 15, 2008 8:31 AM

                  T 1 Reply Last reply
                  0
                  • G Giorgi Dalakishvili

                    You can use FindWindow Function[^] to find handle of the window if you know its current title. You can also use GetForegroundWindow Function[^] to find handle of foreground window or you can call EnumWindows Function[^] to enumerate all open windows. Which window do you want to change text for?

                    Giorgi Dalakishvili #region signature my articles #endregion

                    modified on Sunday, June 15, 2008 8:31 AM

                    T Offline
                    T Offline
                    That Asian Guy
                    wrote on last edited by
                    #9

                    Alright, thanks it works!

                    G 1 Reply Last reply
                    0
                    • T That Asian Guy

                      Alright, thanks it works!

                      G Offline
                      G Offline
                      Giorgi Dalakishvili
                      wrote on last edited by
                      #10

                      Glad to help you :)

                      Giorgi Dalakishvili #region signature my articles #endregion

                      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