Results 1 to 3 of 3

Thread: Getting the text from a window

  1. #1

    Thread Starter
    Lively Member DeBauer's Avatar
    Join Date
    May 2001
    Location
    Mako Reactor #7
    Posts
    123

    Getting the text from a window

    When I try to get the text from this application it won't work, this is the code im using


    public sub blah
    Dim x As Long, editx As Long
    x = FindWindow("#32770", vbNullString)
    editx = FindWindowEx(x, 0&, "edit", vbNullString)
    Dim TheText As String, TL As Long
    TL = SendMessageLong(editx, WM_GETTEXTLENGTH, 0&, 0&)
    TheText = String(TL + 1, " ")
    Call SendMessageByString(editx, WM_GETTEXT, TL + 1, TheText)
    TheText = Left(TheText, TL)
    end sub

    I put the following in a timer to see if it is getting anything and its not

    call blah
    text1.text = TL


    Why won't it work?

    thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Check your thread in General Development.

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You have to send your string buffer ByVal:
    Code:
    Call SendMessageByString(editx, WM_GETTEXT, TL + 1, ByVal TheText)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width