Results 1 to 7 of 7

Thread: window doesn't paint properly, scroll, after recieving WM_GETTEXT

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    NYC
    Posts
    52
    ^----- top.

    Why would sending these messages mess with the window's scrolling and painting?

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    why not use the GetWindowTextLength and GetWindowText functions! Much simpler
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    NYC
    Posts
    52

    it's in another process

    From the Win32 API Documentation for GetWindowText:
    To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
    So I have to use the SendMessage calls instead of GetWindowText.



  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    i do it all the time and it works fine in other proccess.
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    NYC
    Posts
    52
    The problem is that I need to retrieve the text from WITHIN the control of the other process... GetWindowText just returns the window title ("AteWindow"), not the actual contents of the RichTextBox control (e.g. "<HTML><BODY>...").

    The code I used was:
    Code:
    Public Function GetText(Window As Long) As String
    'Gets any text from a window
    Dim Cursor As String, Text As Long
    'Text& = SendMessage(Window&, WM_GETTEXTLENGTH, 0&, 0&)
    Text = GetWindowTextLength(Window)
    Cursor$ = String(Text&, 0&)
    'Call SendMessageByString(Window&, WM_GETTEXT, Text& + 1, Cursor$)
    Call GetWindowText(Window, Cursor, Text + 1)
    GetText$ = Cursor$
    End Function

  6. #6
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    i see now
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    NYC
    Posts
    52
    Aargh this is still bothering me (and a ton of users who downloaded my program!)!

    Can some API guru please tell me why this is happening and how I can remedy it?

    --Josh

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