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. Problem in retrieving text using WM_GETTEXT

Problem in retrieving text using WM_GETTEXT

Scheduled Pinned Locked Moved C / C++ / MFC
help
8 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.
  • J Offline
    J Offline
    Javagal Srinath
    wrote on last edited by
    #1

    Hi I was using sendmesage function to a window in my DLL which is attached to other application using windows hook, mainly to get text from a control. sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext); To my surprise sendmessage was not able to retrieve text in sztext. could the problem lies in the creator of application who has not properly written code in WM_GETTEXT case. I think he/she may not have written appropriate code to provide proper response when send message function with WM_GETTEXT is called. Am I wrong in analysing please reply if u have encountered a problem like this before thanks

    S R D 3 Replies Last reply
    0
    • J Javagal Srinath

      Hi I was using sendmesage function to a window in my DLL which is attached to other application using windows hook, mainly to get text from a control. sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext); To my surprise sendmessage was not able to retrieve text in sztext. could the problem lies in the creator of application who has not properly written code in WM_GETTEXT case. I think he/she may not have written appropriate code to provide proper response when send message function with WM_GETTEXT is called. Am I wrong in analysing please reply if u have encountered a problem like this before thanks

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      It's hard to say. Here[^] is an interesting article on WM_GETTEXT and GetWindowText. Steve

      J 1 Reply Last reply
      0
      • J Javagal Srinath

        Hi I was using sendmesage function to a window in my DLL which is attached to other application using windows hook, mainly to get text from a control. sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext); To my surprise sendmessage was not able to retrieve text in sztext. could the problem lies in the creator of application who has not properly written code in WM_GETTEXT case. I think he/she may not have written appropriate code to provide proper response when send message function with WM_GETTEXT is called. Am I wrong in analysing please reply if u have encountered a problem like this before thanks

        R Offline
        R Offline
        Rage
        wrote on last edited by
        #3

        Was it a password edit box ? ~RaGE();

        I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

        J 1 Reply Last reply
        0
        • S Stephen Hewitt

          It's hard to say. Here[^] is an interesting article on WM_GETTEXT and GetWindowText. Steve

          J Offline
          J Offline
          Javagal Srinath
          wrote on last edited by
          #4

          Thanks link was highly usefull.

          1 Reply Last reply
          0
          • R Rage

            Was it a password edit box ? ~RaGE();

            I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

            J Offline
            J Offline
            Javagal Srinath
            wrote on last edited by
            #5

            No it was dialog box. I dont have to write program to retrive passwords, it is already written by others.I can find some here

            R 1 Reply Last reply
            0
            • J Javagal Srinath

              Hi I was using sendmesage function to a window in my DLL which is attached to other application using windows hook, mainly to get text from a control. sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext); To my surprise sendmessage was not able to retrieve text in sztext. could the problem lies in the creator of application who has not properly written code in WM_GETTEXT case. I think he/she may not have written appropriate code to provide proper response when send message function with WM_GETTEXT is called. Am I wrong in analysing please reply if u have encountered a problem like this before thanks

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

              Javagal Srinath wrote:

              sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext);

              Is hwnd a valid window handle?

              Javagal Srinath wrote:

              To my surprise sendmessage was not able to retrieve text in sztext.

              How was sztext declared?


              "The largest fire starts but with the smallest spark." - David Crow

              "Judge not by the eye but by the heart." - Native American Proverb

              J 1 Reply Last reply
              0
              • J Javagal Srinath

                No it was dialog box. I dont have to write program to retrive passwords, it is already written by others.I can find some here

                R Offline
                R Offline
                Rage
                wrote on last edited by
                #7

                Javagal Srinath wrote:

                I dont have to write program to retrive passwords, it is already written by others.I can find some here

                No offense meant, it is only that edit boxes with password option set react differently to the WM_GETTEXT message as when it is not set. ~RaGE();

                I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

                1 Reply Last reply
                0
                • D David Crow

                  Javagal Srinath wrote:

                  sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext);

                  Is hwnd a valid window handle?

                  Javagal Srinath wrote:

                  To my surprise sendmessage was not able to retrieve text in sztext.

                  How was sztext declared?


                  "The largest fire starts but with the smallest spark." - David Crow

                  "Judge not by the eye but by the heart." - Native American Proverb

                  J Offline
                  J Offline
                  Javagal Srinath
                  wrote on last edited by
                  #8

                  hwnd was a window handle returned when a notification that a new window is created was recieved to my filter function cbtproc. The hook code was HCBT_CREATEWND I think sztext was properly declared May be we can not send "sendmessage(hwnd,WM_GETTEXT,(wparam)100,(lparam)sztext);" to retrieve text to all type of window.

                  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