pal 9.4 send text

You can talk about VB programming here

Re: pal 9.4 send text

Postby Departure » Sun Mar 23, 2008 12:16 am


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.
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Re: pal 9.4 send text

Postby Chike » Sun Mar 23, 2008 5:22 am

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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm

Re: pal 9.4 send text

Postby Departure » Sun Mar 23, 2008 11:42 pm

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.
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Re: pal 9.4 send text

Postby String » Mon Mar 24, 2008 12:09 am

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.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: pal 9.4 send text

Postby autopilot » Mon Mar 24, 2008 11:02 am

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.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: pal 9.4 send text

Postby Chike » Mon Mar 24, 2008 12:15 pm

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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm

Re: pal 9.4 send text

Postby autopilot » Mon Mar 24, 2008 2:01 pm

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:
Code: Select all
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:
Code: Select all
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:
Code: Select all
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).
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: pal 9.4 send text

Postby autopilot » Mon Mar 24, 2008 2:09 pm

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.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: pal 9.4 send text

Postby locohacker » Fri Mar 28, 2008 10:37 am

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
Code: Select all
 ' 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
Code: Select all
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

Code: Select all
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:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby Chike » Fri Mar 28, 2008 12:35 pm

green or black name?
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm

Re: pal 9.4 send text

Postby autopilot » Fri Mar 28, 2008 2:08 pm

your problem is in the following if statement:
Code: Select all
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:
Code: Select all
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?
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: pal 9.4 send text

Postby locohacker » Fri Mar 28, 2008 2:49 pm

Its black :) ah so now is different for both black and green, aigh I gona check it
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby locohacker » Fri Mar 28, 2008 3:03 pm

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, :roll: now how in hell we gonna know they blue or green or damn purple :mrgreen:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby Chike » Fri Mar 28, 2008 5:14 pm

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.
extra.PNG
extra.PNG (5.02 KiB) Viewed 619 times
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm

Re: pal 9.4 send text

Postby Departure » Fri Mar 28, 2008 6:26 pm

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
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

PreviousNext

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests