^----- top.
Why would sending these messages mess with the window's scrolling and painting?
^----- top.
Why would sending these messages mess with the window's scrolling and painting?
why not use the GetWindowTextLength and GetWindowText functions! Much simpler
From the Win32 API Documentation for GetWindowText:
So I have to use the SendMessage calls instead of GetWindowText.Quote:
To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
i do it all the time and it works fine in other proccess.
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
i see now
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