Skip to content

How To Get Text From PalTalk

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #189666
    Johnny5
    Member

    Hello all,

    I’m new here, just need some help on how to get text from the chatbox (RichEdit20A) window “#32770” old paltalk version. How to get a command trigger like “!” ?

    Thank Adavance,

    #189672
    Johnny5
    Member

    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
    #189671

    tell yah what, ill find the coding from me age checker from 553, gets room anme if thats what uw ant

    #189670
    Departure
    Member

    hmm notice how so many people use the window handel #32770, i am sure everyone is aware that alot of programs also have this window handel, so in other words if you have an app runing the same time as your paltalk and say for example it uses the same window handel #32770 and is on top of paltalk you are going to run into some trouble…. But the good news is there is a way to fix this and should be used at all times (in my option)… and that is by using a wild card, for example we all know that paltalk room all end with “Voice Conference” so the wild card would be *Voice Conference, as as that and now the code to help find that wild card :O(

    BTW this is for older version paltalk and you will have to subclass it to suit the newer version, wich is easy using a good API spy like PAT and JK’s API spy.. anyway the code

    Public Function Palsend(Sendit As String)
    Dim PaltalkHwnd As Long
    Dim PaltalkEdit As Long
    Dim SendKey As Long
    Dim Palb As Long
    PaltalkHwnd = FindWindowWild("*Voice Conference", False)
    PaltalkEdit = FindWindowEx(PaltalkHwnd, 0&, "RichEdit20A", vbNullString)
    PaltalkEdit = FindWindowEx(PaltalkHwnd, PaltalkEdit, "RichEdit20A", vbNullString)
    Call SendMessageByString(PaltalkEdit, WM_SETTEXT, 0, Sendit$)
    If PaltalkEdit = 0 Then
    MsgBox (".::Paltalk Room is not open::.")
    End
    Exit Function
    End If
    Do
    DoEvents
    PaltalkHwnd = FindWindowWild("Voice Confrence", False)
    Palb = FindWindowEx(PaltalkHwnd, 0&, "PALBUTTON", vbNullString)
    Palb = FindWindowEx(PaltalkHwnd, Palb, "PALBUTTON", vbNullString)
    Palb = FindWindowEx(PaltalkHwnd, Palb, "PALBUTTON", vbNullString)
    Call SendMessageLong(Palb, WM_LBUTTONDOWN, 0&, 0&)
    Call SendMessageLong(Palb, WM_LBUTTONUP, 0&, 0&)
    If Palb = 0 Then
    MsgBox ".::Palbutton error::."
    End
    Exit Function
    End If
    Loop Until Palb  0
    End Function
    Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
    Dim k As Long, sName As String
    If IsWindowVisible(hwnd) And GetParent(hwnd) = 0 Then
    sName = Space$(128)
    k = GetWindowText(hwnd, sName, 128)
    If k > 0 Then
    sName = Left$(sName, k)
    If lParam = 0 Then sName = UCase(sName)
    If sName Like sPattern Then
    hFind = hwnd
    EnumWinProc = 0
    Exit Function
    End If
    End If
    End If
    EnumWinProc = 1
    End Function
    
    Public Function FindWindowWild(sWild As String, Optional bMatchCase As Boolean = True) As Long
    sPattern = sWild
    If Not bMatchCase Then sPattern = UCase(sPattern)
    EnumWindows AddressOf EnumWinProc, bMatchCase
    FindWindowWild = hFind
    End Function

    Ofcause you have to also Publicl declare funtions,

    Hope this method helps someone, it has worked great for me and i have never ran into
    trouble finding the correct object handel

    #189669
    Admin
    Administrator

    Thanks Departure this should work with paltalk 8 too after little tweaking, I was looking for this type of code to connect to the paltalk room, since the old method paltalk disable it somehow 🙁

    #189668
    Departure
    Member

    Yeap it does work with paltalk 8 as i have already subclassed it, and it works with out a problem :O)

    #189667
    Admin
    Administrator

    Thas great 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.