Will This Works? I've try it but no sign
Function LastChatLineWithSN()
On Error Resume Next
Dim LastLine
Dim lastlen
Dim TheChatText As String
Dim TheChars As String
Dim TheChar As String
Dim FindChar
Dim ChatText As String
ChatText$ = GetChatText
For FindChar = 1 To Len(ChatText$)
TheChar$ = Mid(ChatText$, FindChar, 1)
TheChars$ = TheChars$ & TheChar$
If TheChar$ = Chr(13) Then
TheChatText$ = Mid(TheChars$, 1, Len(TheChars$) - 1)
Form1.Text1.text = TheChatText$
TheChars$ = ""
End If
Next FindChar
lastlen = Val(FindChar) - Len(TheChars$)
LastLine = Mid(ChatText$, lastlen, Len(TheChars$))
LastChatLineWithSN = LastLine
End Function
Function LastChatLine()
On Error Resume Next
Dim ChatTrim As String
Dim ChatTrimNum
Dim ChatText
ChatText = LastChatLineWithSN
ChatTrimNum = Len(SNFromLastChatLine)
ChatTrim$ = Mid$(ChatText, ChatTrimNum + 4, Len(ChatText) - Len(SNFromLastChatLine))
LastChatLine = ChatTrim$
End Function
Public Function GetText(WinHandle As Long) As String
Dim abc As String, TxtLength As Long
TxtLength& = SendMessage(WinHandle&, WM_GETTEXTLENGTH, 0&, 0&)
abc$ = String(TxtLength&, 0&)
Call SendMessageByString(WinHandle&, WM_GETTEXT, TxtLength& + 1, abc$)
GetText$ = abc$
End Function
Function GetChatText()
On Error Resume Next
Dim ChatText
Dim AORich As Long
Dim Room As Long
Call GetPalWindow
Dim sp1 As Long
Dim sp2 As Long
sp1 = FindWindow("#32770", strWindowTitle)
sp1 = FindWindowEx(sp1, 0, "#32770", vbNullString)
sp2 = FindWindowEx(sp1, 0, "RichEdit20A", vbNullString)
sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString)
sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString)
sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString)
ChatText = GetText(sp2)
GetChatText = ChatText
End Function
Public Function GetText1(Get_hWnd As Long) As String
On Error Resume Next
Dim retVal As Long, lenTxt As Integer, retText As String
lenTxt = SendMessageLong(Get_hWnd, WM_GETTEXTLENGTH, 0&, 0&)
retText = String(lenTxt + 1, " ")
Call SendMessageByString(Get_hWnd, WM_GETTEXT, lenTxt + 1, retText)
GetText1 = Left(retText, lenTxt)
End Function