pal 9.4 send text

You can talk about VB programming here

Re: pal 9.4 send text

Postby String » Sat Mar 29, 2008 2:47 am


locohacker wrote: now how in hell we gonna know they blue or green or damn purple :mrgreen:

I first added a setting, asking the user if they were using black nic OR not.
If they were using black, set the 9.4 data. If they were not, set the old 9.1,2,3 data, the old code still works for all colored nics that are using 9.4, in my testing anyway.

I missed AutoPilots post above until just now. After looking at it, it appears that you wont have to determine the color of the nic. As long as the incoming/outgoing richedit20 control always stays inside WTL_SplitterWindow 4. I need to have a look.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: pal 9.4 send text

Postby locohacker » Fri Apr 04, 2008 3:09 pm

String :) i was thinking bout it, that might be the best way to go cause other ways might take too much coding and cpu usage, just a simple nick color choice be best.

one off question where ya guys find the index of the rich box, I mean what program ya use cause?
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby String » Fri Apr 04, 2008 4:34 pm

To find the index I used the tools described here. Specifically the one called Auto Hotkey. The program itself isnt any help, but inside it has a feature called "AutoIt3 Window Spy". This is the only window spy Ive seen that gives the index of each control.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: pal 9.4 send text

Postby Departure » Sat Apr 05, 2008 8:02 am

to find the index just use ANY api spy and count the number of controls remembering that 0 = 1 so if it has a index of of zero thats the first contol. an example of this would be if you wanted the 5th control the index would be 4
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 locohacker » Sat Apr 05, 2008 1:35 pm

Aigh, Got it :)
So here what I ended up doing :)
Fist I added a new paltalk94 on general
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 = 4 ' All Pal Versions
    Const SendTxtIndex942 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"

Ya can see there are two Const SendTxtIndex one with "4" for black nicks and the other with "2" for plus nicks.
and in form load I updated the cases to this
Code: Select all
Dim i As Integer
    i = ReadPalVersion
    Select Case i
        Case 0
    '        Label1.Caption = "No Pal Found"
        Case 8
    '        Label1.Caption = "Pal v8 Found"
            SetPalVer8
        Case 94
    '        Label1.Caption = "Pal v9 Found"
            SetPalVer94
        Case 9
    '        Label1.Caption = "Pal v9 Found"
            SetPalVer9
        Case Else
    '        Label1.Caption = "No Pal Found"
    End Select

Then I created a new sub SetPalVer
Code: Select all
Private Sub SetPalVer94()
        WindowClass = WindowClass94
        RoomOutboundTextBoxClass = RoomOutboundTextBoxClass94
        SysListCtrlClass = SysListCtrlClass94
        BounceReasonTextBoxClass = BounceReasonTextBoxClass94
        BounceButtonClass = BounceButtonClass94
        BounceClass = BounceClass94
        ChaTxtIndex = ChaTxtIndex94
        NicListIndex = NicListIndex94
        If Option5.Value = True Then
        SendTxtIndex = SendTxtIndex94
        Else
        SendTxtIndex = SendTxtIndex942
        End If
        BounceTextIndex = BounceTextIndex94
        BounceCloseIndex = BounceCloseIndex94
        BannerClass = BannerClass94
    End Sub

Ya will notice this code
Code: Select all
If Option5.Value = True Then
        SendTxtIndex = SendTxtIndex94
        Else
        SendTxtIndex = SendTxtIndex942
        End If

That depends in which nick color selection the user chooses
I added two options to choose black nick or plus
Now when the option is click I added this code for to refresh the pal case selection
Code: Select all
Dim i As Integer
    i = ReadPalVersion
    Select Case i
        Case 0
    '        Label1.Caption = "No Pal Found"
        Case 8
    '        Label1.Caption = "Pal v8 Found"
            SetPalVer8
        Case 94
    '        Label1.Caption = "Pal v9 Found"
            SetPalVer94
        Case 9
    '        Label1.Caption = "Pal v9 Found"
            SetPalVer9
        Case Else
    '        Label1.Caption = "No Pal Found"
    End Select

Then also I updated the ReadPalVersion to this
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.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
End Function

Lol, one thing I putting this long post up in here so I remind myself the steps for updating the other programs, and for some hook ups ya guys might thing it can be improve,

ah here the funtext 9.4 the source code in case ya wanna check it ;)
Attachments
Paltalk FunText any Pal 8 or 9 vb94.rar
(54.07 KiB) Downloaded 69 times
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby String » Sun Apr 06, 2008 8:43 am

Use the program I mentioned above. Just hover your mouse over the richedit box and its index will be displayed in the spy like this.
RichEdit20A4
RichEdit20A5
The last number being the index. 4 and 5 are the outgoing/incoming index for the current beta, repesectivly(black nic)
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: pal 9.4 send text

Postby locohacker » Sun Apr 06, 2008 9:19 am

Ah so they changing that shit in every build :) ehheh that suks, I might go to back to the old code tyl they solve this confusion :swift:
Bright aways this code
Code: Select all
Sub RoomSend(Text As String)
Dim parent, child, alt, rich20 As Long
parent = FindWindow("DlgGroupChat Window Class", Form1.Text1.Text)
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

It shoudl work with both black and plus nicks right :roll:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby autopilot » Sun Apr 06, 2008 3:30 pm

i have pal 9.1 on this pc that i am on at the moment... I updated the funtext and it should work with any pal9... i removed pal8 support (did not remove the code, but made some changes that are for 9 only, so just disabled pal8 support)... test it out and let me know
Attachments
Paltalk FunText any Pal9.zip
Funtext pal9
(57.42 KiB) Downloaded 72 times
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 » Sun Apr 06, 2008 3:45 pm

Ah, I tried, I mean I using pal 9.4 build 246 and it didnt send the text :( I think is that they chnage the index or something :roll:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby Departure » Sun Apr 06, 2008 9:41 pm

Paltalk are doing this stop programmers like us making 3rd party apps that improve paltalk, I suggest you guys wait untill they make a final version, After all they can'nt keep updating final versions...
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 » Sun Apr 06, 2008 9:43 pm

Loco, I think AutoPilot just forgot to comment out one line of code.

In the project Autopilot submitted,in your Sub RoomSend, comment out (or remove)this line:
Code: Select all
iHnd = getPalSubForm(Form1.WindowClass, Form1.Combo1.Text, Form1.RoomOutboundTextBoxClass, Form1.SendTxtIndex)

and it works fine.
Im guessing Autopilot didnt notice this because if he is using 9.1, as stated in another post, it worked. It will still work with 9.x when this line is removed.

Paltalk are doing this stop programmers like us making 3rd party apps

You really think its being done purposfully? I suspect thats it being done incidently and only due to the addition of other richtxt controls.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: pal 9.4 send text

Postby Departure » Sun Apr 06, 2008 10:19 pm

Your proberly right but its a good rumor to start up LOL, But I still suggest waiting for final version...

Btw way I have an idea that will actually work with ALL paltalk versions and builds, no need to change index numbers ect...
It simple , After looking at all the current working paltalks from build 9.1 -> 9.4 they all have one thing in common and that is the richedit20A after the first AltAxWin71 is always the room chat window, and the second one is always the send text box. Now if you add a counter on the emulatechildwindow to grab the 1st or 2nd richedit20A ONLY after the AltAxWin71 control, so this would garantee you always get the correct richedit20A and it does'nt matter what build your using :)

I will write it in delphi to show proof of concept...
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 Departure » Sun Apr 06, 2008 11:12 pm

I change my above stament, It is true that paltalk have one common thing with AtlAxWin71 control, I just wrote the wrong order,

The following works for paltalk 9.4 build 243,244, 245 And paltalk 9.2 236 I have'nt got other paltalk builds to try it.

SendText Richedit20A = Second Richedit20A control After the first AtlAxWin71
GetText Richedit20A = First Richedit20A control After Second AtlWin71

Using this infomation and the following functions I made in Delphi you will successfully get correct handel every time

Following Code is for delphi and pretty much works the same as autopilots vb.net code

forms var's
Code: Select all
Counter  : integer;
  Cnt      : Integer;
  FWCWnd   : integer;
  ControlFound: Hwnd;


Forms function to get any handel
Code: Select all
function EnumChildProc(Wnd: hWnd; lParam: longint):BOOL; stdcall;
var
szClassName:Array[0..255] of char;
begin
GetClassName(Wnd,szClassName,SizeOf(szClassName));
if StrPas(szClassName) = CMatch Then
begin
Counter := Counter + 1;
Result := Counter <> cnt;
if not result then
FWCWnd := Wnd;
end;
end;

//Custom function to pass to emnulatechildproc
function GetControlHandel(Parent: integer; Controlname: string; NrControl: integer): integer;
begin
FWCWnd := 0;
strpcopy(CMatch, Controlname);
Cnt := NrControl;
EnumChildWindows(Parent, @EnumChildProc, 0);
GetControlHandel := FWCWnd;
end;

//Example how to use GetControlHandel Function
procedure TForm1.Button1Click(Sender: TObject);
Var
PalRoomHwnd: Hwnd;
AtlAxWin71Hwnd: Hwnd;
NrItems: Integer;
begin
PalRoomHwnd := Findwindow('dlggroupchat window class',Nil);
//Get the first AtlWin71 control handel
AtlAxWin71Hwnd:= GetControlHandel(PalRoomHwnd,'AtlAxWin71', 1);
// Reset the counter to use in next GetControlHandel Function
counter:= 0;
//GetControlHandel(ParentControl, Name of control, Number of control (incase same name));
ControlFound := GetControlHandel(AtlAxWin71Hwnd,'RichEdit20A', 2);
//Show message with handel found
Showmessage(inttostr(ControlFound));
// Reset counter for next time
counter:= 0;
end;



How the custom fucntion works is simple
GetControlHandel(ParentControl, Name of control, Number of control (incase same name));

So for AtlAxWin71 control and I wanted to get the fist one i would do
AtlAxWin71Hwnd = GetControlHandel(Palwindow, 'AtlAxWin71', 1);

That would return the handel of AtlAxWin71(first instance of this control)
Then I would do the following to get the send text handel
SendTextHwnd = GetControlHandel(AtlAxWin71Hwnd, 'RichEdit20A, 2);

I hope this helps someone, any question on how this works just ask.

P.s you could do the same by using autopilots code but find the first or Second AtlAxWin71 control before you get the Richedit20A control handel, The richedit20a handel never changes after AtlAxWin71 control. I have'nt tested autopilots code because I dont have vb.net and only have delphi installed but by looking how he has done his code it should work with his also
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 locohacker » Thu Apr 10, 2008 12:04 pm

ah thanks string, now it works :) so I still have to deal with the index changes or this code doesnt rely on it :roll:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: pal 9.4 send text

Postby autopilot » Thu Apr 10, 2008 1:06 pm

locohacker wrote:ah thanks string, now it works :) so I still have to deal with the index changes or this code doesnt rely on it :roll:

if I left the nic color radiobuttons on the form, they are not needed and can be removed... you do not need to set 2 different indexes based on version...

but please note that i made it not function with pal8... the code needs alot of cleanup to remove all the crap for 8
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

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