Hey all,
I must be missing something really obvious here. I need to get a function to get the text from a pal room and I cant seem to get this code going. Let me post what I have and if someone could get me started in the right direction, that would be awesome.
Function lastline()
Dim iHnd As Long
On Error Resume Next
iHnd = ReadTextHnd
Dim X As Long
Dim xx As Long
Dim xxx As String
Dim xxxx As String
Dim xxxxx As String
Dim xxxxxx As String
Dim xxxxxxx As String
Call GetWindowText(iHnd, WM_GETTEXT, 4)
'X = GetTextPal
'X = GetWindowText
For xx = 1 To Len(X)
xxx = Mid(X, xx, 1)
xxxx = xxxx & xxx
If xxx = Chr(13) Then
xxxxx = Mid(xxxx, 2, Len(xxxx) - 1)
frmMain.RichTextBox2.Text = xxxxx
xxxx = ""
End If
Next xx
xxxxxx = Val(xx) - Len(xxxx)
xxxxxxx = Mid(X, xxxxxx, Len(xxxx))
lastline = xxxxxxx
End Function
To be honest, I dont know what the cch variable is. And this code returns 0 for iHnd.
I know some of this is an old method, but it didnt hurt anything to leave stuff there till I figured out what I was doing wrong.