Skip to content

pal 9.4 send text

Viewing 15 posts - 1 through 15 (of 48 total)
  • Author
    Posts
  • #187599
    jimmyng
    Member

    hi

    how to send text to pal 9.4 it doen’t work with old code

    please share to me

    thanks

    #187646
    Admin
    Administrator

    umm which code ya using, cause i try the one I use for paltalk 9.2 and it works this one I mean :swift:

    Sub RoomSend(Text As String)
    Dim parent, child, alt, rich20 As Long
    parent = FindWindow("DlgGroupChat Window Class", vbNullString)
    child = FindWindowEx(parent, 0, "WTL_SplitterWindow", vbNullString)
    child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
    child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
    child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
    alt = GetWindow(child, GW_Child)
    alt = GetWindow(alt, GW_HWNDNEXT)
    alt = FindWindowEx(alt, 0, "atlaxwin71", vbNullString)
    alt = FindWindowEx(alt, 0, "#32770", vbNullString)
    rich20 = FindWindowEx(alt, 0, "RichEdit20A", vbNullString)
    rich20 = FindWindowEx(alt, rich20, "RichEdit20A", vbNullString)
    Call SendMessageSTRING(rich20, WM_SETTEXT, 0&, Text$)
    Call SendMessageLong(rich20, WM_KEYDOWN, 13, 0&)
    End Sub`
    And to call it in the form use this
    Call RoomSend(RichTextBox1.TextRTF)
    And on the module add this
    `Option Explicit
    Public Declare Function INIWRITE Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
    Public Declare Function INIGET Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    Public Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long)
    Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
    Public Declare Function IsWindowVisible& Lib "user32" (ByVal hWnd As Long)
    Public Declare Function GetParent& Lib "user32" (ByVal hWnd As Long)
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
    Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Public Const WM_GETTEXTLENGTH = &HE
    Public Const WM_LBUTTONDOWN = &H201
    Public Const WM_LBUTTONUP = &H202
    Public Const WM_SETTEXT = &HC
    Public Const WM_GETTEXT = &HD
    Private Const WM_KEYDOWN = &H100
    Private Const HTCAPTION = 2
    Dim sPattern As String, hFind As Long
    Public Const GW_Child As Long = 5
    Private Const GW_HWNDNEXT = 2
    #187645
    jimmyng
    Member

    hi

    i tried the code it work for 9.2 but not work for 9.4 i still don’t know why

    any idea ??pls

    thanks

    #187644
    Admin
    Administrator

    Umm aigh lets see you don’t get any errors and how it does not work does the text not appear on the chat rooms, if ya want i can take a quick look at ya code if ya want :swift:

    #187643
    String
    Member

    If you are using AutoPilots method (and you really should), You just need to set up some code for 9.4 and set the Const SendTxtIndex to 2 for the current beta.

    #187642
    Admin
    Administrator

    Hey string where is Const SendTxtIndex
    i am trying to updates the A1 program tha auto made for me 🙂 ah here the module where the Roomsend is to send the text, and i dont find it 🙄

    Option Explicit
    Public Declare Function INIWRITE Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
    Public Declare Function INIGET Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    Public Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long)
    Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
    Public Declare Function IsWindowVisible& Lib "user32" (ByVal hWnd As Long)
    Public Declare Function GetParent& Lib "user32" (ByVal hWnd As Long)
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
    Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    
    Public Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long
    
    Public Const EM_SETSEL = 177
    Public Const EM_GETSEL = 176
    Public Const WM_CUT = 768
    Public Const WM_PASTE = 770
    
    Public Const WM_GETTEXTLENGTH = &HE
    Public Const WM_LBUTTONDOWN = &H201
    Public Const WM_LBUTTONUP = &H202
    Public Const WM_SETTEXT = &HC
    Public Const WM_GETTEXT = &HD
    Private Const WM_KEYDOWN = &H100
    Private Const HTCAPTION = 2
    Dim sPattern As String, hFind As Long
    Public Const GW_Child As Long = 5
    Private Const GW_HWNDNEXT = 2
    Sub RoomSend(Text As String)
    Dim iHnd As Long
    Dim res&, sel&, start_pos&, end_pos&, txt_len&
    iHnd = getPalSubForm(Form1.WindowClass, Form1.Combo1.Text, Form1.RoomOutboundTextBoxClass, Form1.SendTxtIndex)
    
    'disable editing, may not be needed
    Call EnableWindow(iHnd, 0)
    'Copy Text that has been typed in if any
    txt_len& = SendMessage(iHnd, WM_GETTEXTLENGTH, 0, 0)
    If txt_len& > 0 Then ' don't need all this if user not typing
    ' save user selection / cursor position
    Call SendMessage(iHnd, EM_GETSEL, ByVal VarPtr(start_pos&), ByVal VarPtr(end_pos&))
    ' select all text and cut
    res = SendMessage(iHnd, EM_SETSEL, 0, ByVal txt_len&)
    res = SendMessage(iHnd, WM_CUT, 0, 0)
    End If
    Call SendMessageSTRING(iHnd, WM_SETTEXT, 0&, Text$)
    Call SendMessageLong(iHnd, WM_KEYDOWN, 13, 0&)
    'Send any typing back to box
    If txt_len& > 0 Then
    ' text box is empty, paste saved text
    res& = SendMessage(iHnd, WM_PASTE, 0, 0)
    ' restore selection / cursor position
    res& = SendMessage(iHnd, EM_SETSEL, start_pos&, ByVal end_pos&)
    End If
    'enable editing
    Call EnableWindow(iHnd, 1)
    End Sub
    
    Private Function getPalSubForm(ByVal TargetWinClass As String, _
    ByVal TargetWinCaption As String, ByVal TargetSubClass As String, _
    ByVal TargetSubClassIndex As Integer) As Long
    'set variables in module
    mTargetWinClass = TargetWinClass
    mTargetWinCaption = TargetWinCaption
    mTargetSubClass = TargetSubClass
    mTargetSubClassIndex = TargetSubClassIndex
    'set variables for EnumWindows function
    Dim lRet As Long
    Dim lParam As Long
    'Enum sub windows to get hnd for target
    lRet = EnumWindows(AddressOf FindSubWinds, lParam)
    'return target hnd
    getPalSubForm = mSubFormHnd
    End Function
    #187641
    Chike
    Member

    @Admin wrote:

    Hey string where is Const SendTxtIndex

    SendTxtIndex9, but you’ll need to make a new one and change SetPalVer9 ReadPalVersion and whatever sub is calling them if you want them to work with pal 9.1 & 9.2.

    #187640
    Admin
    Administrator

    Aigh so you mean I should play with this part of the code 🙄

     ' PalTalk v9
    Const WindowClass9 As String = "DlgGroupChat Window Class" ' PalTalk v9
    Const RoomOutboundTextBoxClass9 As String = "RichEdit20A" ' PalTalk v9
    Const SysListCtrlClass9 As String = "SysListView32" ' PalTalk v9
    Const BounceReasonTextBoxClass9 As String = "Edit" ' PalTalk v9
    Const BounceButtonClass9 As String = "Button" ' PalTalk v9
    Const BounceClass9 As String = "#32770" ' PalTalk v9
    Const ChaTxtIndex9 As Integer = 4 ' PalTalk v9
    Const NicListIndex9 As Integer = 1 ' All Pal Versions
    Const SendTxtIndex9 As Integer = 3 ' All Pal Versions
    Const BounceTextIndex9 As Integer = 1 ' All Pal Versions
    Const BounceCloseIndex9 As Integer = 1 ' All Pal Versions
    Const BannerClass9 As String = "Internet Explorer_Server"

    I’m thinking I should ask auto to update it for me lol and stay lazy :swift:

    #187639
    String
    Member
    Const SendTxtIndex9 As Integer = 3 ' for pal9.1,2,3
    'This index changes to "2" for pal9.4(beta)

    And as Chike stated, you’ll need to change Sub ReadPalVersion and Sub SetPalVer9 to read the 9.4(beta)

    #187638
    autopilot
    Member

    i have started using properties to set pal version variables. The attached project is a VB 2005 project.

    it uses System.Diagnostics.FileVersionInfo to read the file version of the paltalk.exe.

    Private _PalMajorVer As Integer
    Public ReadOnly Property PalMajorVer() As Integer
    Get
    If _PalMajorVer = 0 Then
    Try
    If mdlPalInfo.PalPath "Not Found" Then
    'This reads the file version information
    ' Paltalk calls this the Application version
    ' if you look in the About Pal window
    Dim VersionInfo As System.Diagnostics.FileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(mdlPalInfo.PalPath & "paltalk.exe")
    _PalMajorVer = VersionInfo.ProductMajorPart
    _PalMinorVer = VersionInfo.ProductMinorPart
    Else
    _PalMajorVer = 0
    End If
    Catch
    _PalMajorVer = 0
    End Try
    End If
    Return _PalMajorVer
    End Get
    End Property
    
    Private _PalMinorVer As Integer
    Public ReadOnly Property PalMinorVer() As Integer
    Get
    If _PalMinorVer = 0 Then
    Try
    If mdlPalInfo.PalPath "Not Found" Then
    'This reads the file version information
    ' Paltalk calls this the Application version
    ' if you look in the About Pal window
    Dim VersionInfo As System.Diagnostics.FileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(mdlPalInfo.PalPath & "paltalk.exe")
    _PalMinorVer = VersionInfo.ProductMinorPart
    Else
    _PalMinorVer = 0
    End If
    Catch
    _PalMinorVer = 0
    End Try
    End If
    Return _PalMinorVer
    End Get
    End Property
    #187637
    autopilot
    Member

    just noticed an error in the project posted above…

    Private _SendTextIndex As Integer
    Public ReadOnly Property SendTextIndex() As Integer
    Get
    If _SendTextIndex = 0 Then
    If PalMajorVer = 9 Then
    Select Case PalMinorVer
    Case Is > 91
    _SendTextIndex = 4
    Case Else
    _SendTextIndex = 3
    End Select
    Else
    _SendTextIndex = 3
    End If
    End If
    Return _SendTextIndex
    End Get
    End Property`
    needs to be
    ` Private _SendTextIndex As Integer
    Public ReadOnly Property SendTextIndex() As Integer
    Get
    If _SendTextIndex = 0 Then
    If PalMajorVer = 9 Then
    Select Case PalMinorVer
    Case Is > 91
    _SendTextIndex = 2
    Case Else
    _SendTextIndex = 3
    End Select
    Else
    _SendTextIndex = 3
    End If
    End If
    Return _SendTextIndex
    End Get
    End Property
    #187636
    Admin
    Administrator

    Thanks man I gonna check it out next week 🙂
    Hey one thing I am getting a free copy of VB 2008 from microsoft cause I am a student 🙂 now would codes in 2005 be much different to 2008 and which version would you recomend since I can get both ❓
    Thanks

    #187635
    Chike
    Member

    @Admin wrote:

    would codes in 2005 be much different to 2008 and which version would you recomend since I can get both

    Probably exactly the same, get the latest.

    #187634
    autopilot
    Member

    @Admin wrote:

    now would codes in 2005 be much different to 2008 and which version would you recomend

    I have not used VB 2008 yet, but would think that you would be better off with the latest. Most of the 2005 code should be able to be converted without any problems (VB 2008 has a built in code upgrade utility).

    #187633
    String
    Member

    While testing with some friends today, I came across somthing that I hadnt expected. The send code for 9.3 will work fine with 9.4 without modification,,, but only for nics that are not black. The old code seems to work fine with blue, green and etc nics. The modified code for 9.4 does work for black nics but I do not know if it works for blue, green etc.
    Anyone else notice this? Is there a way, programatically, to determine what color of nic the end-user is using? Or am I overlooking something.

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