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