VB 2008 Paltalk Integration

Viewing 15 posts - 16 through 30 (of 57 total)
  • Author
    Posts
  • #33591
    NVYE
    Administrator

    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 🙂

    #33592
    autopilot
    Administrator

    @locohacker 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 🙂

    #33594
    NVYE
    Administrator

    nice …

    #33593
    Locohacker
    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 🙂

    #33595
    autopilot
    Administrator

    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)
    #33596
    Departure
    Administrator

    nice to see you on the forums again autopilot 😉

    #33597
    Locohacker
    Administrator

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

    #33598
    autopilot
    Administrator

    @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 😈

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

    #33601
    autopilot
    Administrator

    @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).

    #33602
    NVYE
    Administrator

    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.

    #33600
    autopilot
    Administrator

    @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 😕

    #33603
    NVYE
    Administrator

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

    #33599
    autopilot
    Administrator

    @NVYE wrote:

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

    thank you… your support is much appreciated

    #33605
    NVYE
    Administrator

    You’re very welcome !!! cheers

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