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. Parameter to hide textbox/label at runtime through SendMessage()

Parameter to hide textbox/label at runtime through SendMessage()

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
9 Posts 4 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.
  • S Offline
    S Offline
    Supriya Tonape
    wrote on last edited by
    #1

    Hello, I want to hide textbox/label at run time, Could you please let me know what's the 2nd parameter to pass to below WIN API function, SendMessage(hComponentName, ?, 0, 0); Best Regards, Supriya

    D C 2 Replies Last reply
    0
    • S Supriya Tonape

      Hello, I want to hide textbox/label at run time, Could you please let me know what's the 2nd parameter to pass to below WIN API function, SendMessage(hComponentName, ?, 0, 0); Best Regards, Supriya

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

      How about WM_SHOWWINDOW?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      C 1 Reply Last reply
      0
      • D David Crow

        How about WM_SHOWWINDOW?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        C Offline
        C Offline
        Code o mat
        wrote on last edited by
        #3

        WM_SHOWWINDOW[^] only notifies the given window that it is about to be hidden or shown, it doesn't actually hide or show the window.

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

        D 1 Reply Last reply
        0
        • S Supriya Tonape

          Hello, I want to hide textbox/label at run time, Could you please let me know what's the 2nd parameter to pass to below WIN API function, SendMessage(hComponentName, ?, 0, 0); Best Regards, Supriya

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          I don't think you can do that with SendMessage (except for maybe doing it indirectly if you show and hide the given window in the message handler), you should use ShowWIndow[^] for this.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

          modified on Tuesday, December 1, 2009 2:45 PM

          S 1 Reply Last reply
          0
          • C Code o mat

            WM_SHOWWINDOW[^] only notifies the given window that it is about to be hidden or shown, it doesn't actually hide or show the window.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

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

            I realized that right after I responded but got distracted with something else before fixing it. Thanks.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            1 Reply Last reply
            0
            • C Code o mat

              I don't think you can do that with SendMessage (except for maybe doing it indirectly if you show and hide the given window in the message handler), you should use ShowWIndow[^] for this.

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

              modified on Tuesday, December 1, 2009 2:45 PM

              S Offline
              S Offline
              Supriya Tonape
              wrote on last edited by
              #6

              Thank you very much for suggestion! I tried below and it worked for me :) hComponentName = GetDlgItem(hDlg,IDC_STATIC3); SendMessage(hComponentName, SW_HIDE, 1, 0); Thanks again. Best Regards, Supriya.

              C 1 Reply Last reply
              0
              • S Supriya Tonape

                Thank you very much for suggestion! I tried below and it worked for me :) hComponentName = GetDlgItem(hDlg,IDC_STATIC3); SendMessage(hComponentName, SW_HIDE, 1, 0); Thanks again. Best Regards, Supriya.

                C Offline
                C Offline
                Code o mat
                wrote on last edited by
                #7

                You can send SW_HIDE to a window to make it hidden? That's completely new to me, i learn something every day, thanks.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

                L 1 Reply Last reply
                0
                • C Code o mat

                  You can send SW_HIDE to a window to make it hidden? That's completely new to me, i learn something every day, thanks.

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Code-o-mat wrote:

                  You can send SW_HIDE to a window to make it hidden?

                  Only if that window processes the WM messages and responds accordingly. Most standard window types in a dialog will do this.

                  S 1 Reply Last reply
                  0
                  • L Lost User

                    Code-o-mat wrote:

                    You can send SW_HIDE to a window to make it hidden?

                    Only if that window processes the WM messages and responds accordingly. Most standard window types in a dialog will do this.

                    S Offline
                    S Offline
                    Supriya Tonape
                    wrote on last edited by
                    #9

                    ok :) Best Regards, Supriya Tonape

                    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