pal 9.4 send text

Viewing 15 posts - 16 through 30 (of 48 total)
  • Author
    Posts
  • #187632
    Departure
    Member

    I found the best way is to enumchild windows, Using that would save you the time to update any code at all, in other words it would work for ALL versions and build of paltalk there are onlyt 2 controls in the main chat room that are richedit20a, and it has always been that way since the first versions of paltalk, So once you use enumchild you would use the second richedit20a control to send text and you would use the first richedit20a handel to get text. Once do that there is no need to update your code ever again unless paltalk add another richedit20a between the first and second richedit20a handels currently there.

    #187631
    Chike
    Member

    @String wrote:

    Is there a way, programatically, to determine what color of nic the end-user is using? Or am I overlooking something.

    Probably overkilling. Don’t you just need to check if the banner is active or not? See if it works when green nick chose to view the banners.
    BTW build 244 is out you may want to see if anything changed with it.

    @Departure wrote:

    I found the best way is to enumchild windows

    autopilot’s code does use the enumchildwindows, something has changed.
    There are at least 4 richedit20 controls there, 2 in 2 #32770 containers, and there is 1 one level above, which is now removed I think, if the banner is off, but that should have changed the room text index too.

    #187630
    Departure
    Member

    I am going to check out new paltalk 9.4 control structor for the chat rooms, Because it should’nt matter if there was 100 richedit20a controls it has always been the second richedit20a to send text thus making any other changes irrelevent. I have’nt looked at autopolits current code as yet but I would’nt mind taking a look to see how he has done it, I always learn something from his code snippets but because I am programming only in delphi I have’nt had a reason to to look at his code.

    #187629
    String
    Member

    Im using the code Autopilot posted here. He has also posted a vs2005 example in this thread.
    @Departure wrote:

    unless paltalk add another richedit20a between the first and second richedit20a handels currently there.

    I think what you described may be what is happening.
    @Chike wrote:

    Don’t you just need to check if the banner is active or not?

    I dont know lol, though not new to programming, I’m very new to programing for paltalk.

    #187628
    autopilot
    Member

    i think Dep finds the window that has the incoming & outgoing richedit boxes and then uses the enumchildwindows, were i use the enumchildwindows on the main room window.

    It does look like pal9.4 has one send text index value for black nic and another for green (i dont have a blue nic to test with, so can not say for sure what the send text index is for blue). but i normally wait untill it is out of beta before i start doing much with changing my code.

    #187627
    Chike
    Member

    @autopilot wrote:

    It does look like pal9.4 has one send text index value for black nic and another for green

    Yes, the “do you want to remove those banner ads?” at the bottom does not exist for green nicks, and probably for blue either, and it’s the first richedit20 control.
    But the code changes you made had one less (2 instead of 3?) and I still see 3 there for green nick.
    You may want to consider adding attribute search for the window you look for. This edit window in particular is the only richedit20 control that has the “OleDropTarget…” atoms in it’s properties.

    #187626
    autopilot
    Member

    there are several different ways to go about doing the task of finding the correct richedit20 control. i did not test it on pal8 but for pal9, if you find the handle for the WTL_SplitterWindow at index 4 (this control contains both the incoming text and the send text), then you can use that control to enumchildwindow to find RichEdit20A index 3 to send & index 4 to read. This then worked for both green and black nic.

    chikes way will work, but i just have never liked to do a lot of window properties… nothing wrong with doin it that way if that is what you like.

    in the SendTextAnyPalVerAutoDetect project that string refferenced, i add to the GetSubFromHnd module:

    Public Function ChatHnd(ByVal hwnd As Long, ByVal lParam As Long) As Long
    Dim RetVal As Long
    mTargetSubClass = "RichEdit20A"
    mTargetSubClassIndex = lParam
    IndexCount = 1
    RetVal = EnumChildWindows(hwnd, AddressOf EnumChildProc, lParam)
    ChatHnd = mSubFormHnd
    End Function

    then added to the form1 code:

    Private Function SendTextHnd() As Long
    Dim iPHnd As Long
    iPHnd = getPalSubForm(WindowClass, Combo1.Text, "WTL_SplitterWindow", 4)
    SendTextHnd = ChatHnd(iPHnd, 3)
    End Function

    Private Function ReadTextHnd() As Long
    Dim iPHnd As Long
    iPHnd = getPalSubForm(WindowClass, Combo1.Text, "WTL_SplitterWindow", 4)
    ReadTextHnd = ChatHnd(iPHnd, 4)
    End Function

    then changed Command1_Click to:

    Private Sub Command1_Click()
    Dim iHnd As Long
    'iHnd = getPalSubForm(WindowClass, Combo1.Text, RoomOutboundTextBoxClass, SendTxtIndex)
    iHnd = SendTextHnd
    Call SendMessageByString(iHnd, WM_SETTEXT, 0&, Text1.Text)
    Call SendMessage(iHnd, WM_KEYDOWN, 13, 0)
    End Sub

    So you can do it what ever way you like… just find a way that you can understand (learn what the code is doing so you can modify it to meet your needs) and will execute efectively (don’t do in 20 steps what you can do in 5).

    #187625
    autopilot
    Member

    just a note… i doubt that the above would be my final solution, but just a quick test i just did to see if it worked. also if it is/was the approach i take/took, the constants would be added to the list of pal8 & pal 9 const and set in the SetPalVer subs.

    #187624
    Admin
    Administrator

    Hey I cant make this code work 🙁 to updates the A1 programs, like this the changes i made
    on form1, under general I added this new lines

     ' PalTalk v94
    Const WindowClass94 As String = "DlgGroupChat Window Class" ' PalTalk v9
    Const RoomOutboundTextBoxClass94 As String = "RichEdit20A" ' PalTalk v9
    Const SysListCtrlClass94 As String = "SysListView32" ' PalTalk v9
    Const BounceReasonTextBoxClass94 As String = "Edit" ' PalTalk v9
    Const BounceButtonClass94 As String = "Button" ' PalTalk v9
    Const BounceClass94 As String = "#32770" ' PalTalk v9
    Const ChaTxtIndex94 As Integer = 4 ' PalTalk v9
    Const NicListIndex94 As Integer = 1 ' All Pal Versions
    Const SendTxtIndex94 As Integer = 2 ' All Pal Versions
    Const BounceTextIndex94 As Integer = 1 ' All Pal Versions
    Const BounceCloseIndex94 As Integer = 1 ' All Pal Versions
    Const BannerClass94 As String = "Internet Explorer_Server"

    basically just change the Const SendTxtIndex94 As Integer to 2

    The created another setpalver

    Private Sub SetPalVer94()
    WindowClass = WindowClass94
    RoomOutboundTextBoxClass = RoomOutboundTextBoxClass94
    SysListCtrlClass = SysListCtrlClass94
    BounceReasonTextBoxClass = BounceReasonTextBoxClass94
    BounceButtonClass = BounceButtonClass94
    BounceClass = BounceClass94
    ChaTxtIndex = ChaTxtIndex94
    NicListIndex = NicListIndex94
    SendTxtIndex = SendTxtIndex94
    BounceTextIndex = BounceTextIndex94
    BounceCloseIndex = BounceCloseIndex94
    BannerClass = BannerClass94
    End Sub

    then here is where I think I am messing up in readpalver

    Private Function ReadPalVersion() As Integer
    Dim mRegAccess As New RegAccess
    Dim sAns As String
    sAns = mRegAccess.ReadString(PalVerRegLoc, "DisplayVersion", "0")
    If sAns "0" Then
    If InStr(sAns, "9.") Then
    ReadPalVersion = 9
    ElseIf InStr(sAns, "9.4") Then
    ReadPalVersion = 94
    ElseIf InStr(sAns, "8.") Then
    ReadPalVersion = 8
    Else
    ReadPalVersion = 0
    End If
    Else
    ReadPalVersion = 0
    End If

    lol and not working :mrgreen:

    #187623
    Chike
    Member

    green or black name?

    #187622
    autopilot
    Member

    your problem is in the following if statement:

    If sAns  "0" Then
    If InStr(sAns, "9.") Then
    ReadPalVersion = 9
    ElseIf InStr(sAns, "9.4") Then
    ReadPalVersion = 94
    ElseIf InStr(sAns, "8.") Then
    ReadPalVersion = 8
    Else
    ReadPalVersion = 0
    End If
    Else
    ReadPalVersion = 0
    End If

    you first check 9. then 9.4… if it finds 9.4, it is still setting it to 9. Change your if statement to:

    If sAns  "0" Then
    If InStr(sAns, "9.4") Then
    ReadPalVersion = 94
    ElseIf InStr(sAns, "9.") Then
    ReadPalVersion = 9
    ElseIf InStr(sAns, "8.") Then
    ReadPalVersion = 8
    Else
    ReadPalVersion = 0
    End If
    Else
    ReadPalVersion = 0
    End If

    But as chike points out, is it a green nic or a black nic?

    #187621
    Admin
    Administrator

    Its black 🙂 ah so now is different for both black and green, aigh I gona check it

    #187620
    Admin
    Administrator

    Aigh got it working 🙂 after reading chik and strings explonation and changing the if ya told me, but I came to the same issue I can make it work by changing the Const SendTxtIndex94 As Integer to 4 instead of 2 but that only works for black nicks I assume, 🙄 now how in hell we gonna know they blue or green or damn purple :mrgreen:

    #187619
    Chike
    Member

    @locohacker wrote:

    now how in hell we gonna know they blue or green or damn purple

    Maybe count how many richedit20 controls you have in the window for pal version 9.4.
    Or just see if you have that extra richedit20 black nicks have.
    [attachment=0:2ppsad9m]extra.PNG[/attachment:2ppsad9m]

    #187618
    Departure
    Member

    I agree with autopolit, Use what works for you and that you understand how it works that way updating would be very easy for the programmer

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