Skip to content

VB 2008 Paltalk Integration

Viewing 15 posts - 16 through 30 (of 57 total)
  • Author
    Posts
  • #190338
    AhFox
    Member

    Well this is what I would do, first check and see if there is any new text.

    Get: text count as long
    If count match with the old text count, then there must be a new text.

    Then get do a GET TEXT .. (otherwise you’re just wasting resources).

    Hope this helps 🙂

    #190337
    autopilot
    Member

    @Admin wrote:

    Thanks Auto 🙂 I am working on a program now ehhehe, hey one thing how to go about getting the index to get the last line

    in my apps, i made a function to return the handle for the outgoing chat and another for the incoming.

    Private Function SendTxtHnd() As Integer ' Outgoing chat box
    Dim iHnd As Integer
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex)
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.SendTextIndex)
    Return iHnd
    End Function
    
    Private Function ReadTxtHnd() As Integer ' Incoming Chat Box
    Dim iHnd As Integer
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex)
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.ReadTextIndex)
    Return iHnd
    End Function

    once you have the handle, you already know how to read the last line of text 🙂

    #190336
    AhFox
    Member

    nice …

    #190335
    Admin
    Administrator

    Na dont get it lol, I mean I am using this

    Dim iHnd As Integer
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex)
    iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.ReadTextIndex)
    
    Me.RichTextBox2.Text = GetLastLineTextChat(iHnd)

    with the old function

    Public Function GetLastLineTextChat(ByVal hwnd As Integer) As String
    Dim lngCount As Integer
    Dim lngLength As Integer
    Dim strBuffer As String
    'Get Line count
    lngCount = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0)
    lngLength = SendMessage(hwnd, EM_LINELENGTH, lngCount - 2, 0)
    'resize buffer
    strBuffer = Space(256)
    'get line text
    
    Call SendMessageStr(hwnd, EM_GETLINE, lngCount - 2, strBuffer)
    GetLastLineTextChat = strBuffer
    
    End Function

    Ah and shit don’t work 🙂

    #190334
    autopilot
    Member

    i dont know why your having problems, but my guess is you dont have the correct handle to the textbox.

    here is an API call i use

    Declare Function SendMessageString Lib "USER32" _
    Alias "SendMessageA" (ByVal hwnd As Integer, _
    ByVal wMsg As Integer, ByVal wParam As Integer, _
    ByVal lParam As StringBuilder) As Integer

    and here is a function that should give you the last line

    Public Function GetLastLineTextChat(ByVal hwnd As Integer) As String
    Dim iLastLine As Integer
    Dim strBuffer As New StringBuilder(255)
    'Get Line count
    iLastLine = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0)
    'get line text
    Call SendMessageString(hwnd, EM_GETLINE, iLastLine - 2, strBuffer)
    Return strBuffer.ToString
    End Function

    and you would call it like

    Dim sChatText as String = GetLastLineTextChat(ReadTxtHnd)
    #190333
    Departure
    Member

    nice to see you on the forums again autopilot 😉

    #190332
    Admin
    Administrator

    Great thanks it works, I did a newbie mistake forgot to to call the api lol 8) thanks

    #190331
    autopilot
    Member

    @Departure wrote:

    nice to see you on the forums again autopilot 😉

    i have been checking the forums, but have not had much to add LOL

    i resopnd when they have questions for me though 😈

    #190330
    method
    Member

    autopilot thanks for your code but could you tell me how to convert it to vb6? All i want to read the lastline from the room.Looking forward for your reply.Thanks

    #190329
    autopilot
    Member

    @method wrote:

    autopilot thanks for your code but could you tell me how to convert it to vb6? All i want to read the lastline from the room.Looking forward for your reply.Thanks

    i dont do much vb6 coding and i sure dont write code in vb6 that i already did in vb2008. if you want it in vb6, convert it yourself (not a problem if you can write vb6 code).

    #190328
    AhFox
    Member

    Nice … Excellent … thanks bro !!

    Is donate to Autopilot Integrations link still working ? I want to donate some money toward your integration just to show my appreciations for all your hard works.

    #190327
    autopilot
    Member

    @NVYE wrote:

    Nice … Excellent … thanks bro !!

    Is donate to Autopilot Integrations link still working ? I want to donate some money toward your integration just to show my appreciations for all your hard works.

    as far a i know the donate link works… my paypal account is still valid, so the link should be fine… have not gotten anything donated in a long time though 😕

    #190326
    AhFox
    Member

    Cool … just donated (5US88407K6984701B). once again … thank you for all your hard works.

    #190325
    autopilot
    Member

    @NVYE wrote:

    Cool … just donated (5US88407K6984701B). once again … thank you for all your hard works.

    thank you… your support is much appreciated

    #190324
    AhFox
    Member

    You’re very welcome !!! cheers

Viewing 15 posts - 16 through 30 (of 57 total)
  • You must be logged in to reply to this topic.