- This topic has 47 replies, 7 voices, and was last updated 16 years ago by Admin.
-
AuthorPosts
-
March 29, 2008 at 7:47 am #187617StringMember
@Admin wrote:
now how in hell we gonna know they blue or green or damn purple
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.
April 4, 2008 at 8:09 pm #187616AdminAdministratorString 🙂 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?
April 4, 2008 at 9:34 pm #187615StringMemberTo 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.
April 5, 2008 at 1:02 pm #187614DepartureMemberto 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
April 5, 2008 at 6:35 pm #187613AdminAdministratorAigh, Got it 🙂
So here what I ended up doing 🙂
Fist I added a new paltalk94 on general' 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 thisDim 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 SelectThen I created a new sub SetPalVer
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 SubYa will notice this code
If Option5.Value = True Then
SendTxtIndex = SendTxtIndex94
Else
SendTxtIndex = SendTxtIndex942
End IfThat 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 selectionDim 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 SelectThen also I updated the ReadPalVersion to this
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 FunctionLol, 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 😉
April 6, 2008 at 1:43 pm #187612StringMemberUse 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)April 6, 2008 at 2:19 pm #187611AdminAdministratorAh 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 codeSub 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 🙄
April 6, 2008 at 8:30 pm #187610autopilotMemberi 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
April 6, 2008 at 8:45 pm #187609AdminAdministratorAh, 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 🙄
April 7, 2008 at 2:41 am #187608DepartureMemberPaltalk 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…
April 7, 2008 at 2:43 am #187607StringMemberLoco, 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:
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.
April 7, 2008 at 3:19 am #187606DepartureMemberYour 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…
April 7, 2008 at 4:12 am #187605DepartureMemberI 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 AtlWin71Using 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
Counter : integer;
Cnt : Integer;
FWCWnd : integer;
ControlFound: Hwnd;
Forms function to get any handel
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
April 10, 2008 at 5:04 pm #187604AdminAdministratorah thanks string, now it works 🙂 so I still have to deal with the index changes or this code doesnt rely on it 🙄
April 10, 2008 at 6:06 pm #187603autopilotMember@Admin wrote:
ah thanks string, now it works 🙂 so I still have to deal with the index changes or this code doesnt rely on it 🙄
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
-
AuthorPosts
Related
- You must be logged in to reply to this topic.