Paltalk get message : C++, C# And Others Programming

Paltalk get message

Here you can talk about C++ And C# And Other languages programming.

Moderator: Departure

Paltalk get message

Postby mr fox » Tue Feb 16, 2010 11:15 am


I am new in this forum and i was looking for codes in c++ to interact with paltalk...
some codes were working i just had to change the Handle Code...
and i was interested in this code written 3 years ago old but very useful:
Code: Select all
int main() {
    HWND mywindowclass = FindWindow("DlgGroupChat Window Class", NULL);
     HWND wtlsplitterwindow = FindWindowEx(mywindowclass, 0, "wtl_splitterwindow", NULL);
     wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0, "wtl_splitterwindow", NULL);
     wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0, "wtl_splitterwindow", NULL);
     wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0, "wtl_splitterwindow", NULL);
     HWND atlfe = GetWindow(wtlsplitterwindow, GW_CHILD);
     HWND atlaxwin = FindWindowEx(atlfe, 0, "atlaxwin71", NULL);
     atlaxwin = FindWindowEx(atlfe, atlaxwin, "atlaxwin71", NULL);
     HWND x = FindWindowEx(atlaxwin, 0, "#32770", NULL);
     HWND richedita = FindWindowEx(x, 0, "richedit20a", NULL);

    // Error Checking:
    if (!mywindowclass)  { printf( "E_WINDOW_NOT_FOUND"); }
    if (!wtlsplitterwindow)  { printf( "E_WINDOW_NOT_FOUND"); }
    if (!atlfe)  { printf( "E_UNABLE_TO_FIND_PARENT"); }
    if (!richedita)  { printf( "E_RICHEDIT_NOT_FOUND"); }


    long lngCount = SendMessage(richedita, EM_GETLINECOUNT, 0, 0);
    long lngLength = SendMessage(richedita, EM_LINELENGTH, lngCount-2, 0);
   TCHAR strBuffer[1024]; *(WORD *) strBuffer = 1024;
   LRESULT bla = SendMessage(richedita, EM_GETLINE, lngCount-2, (LPARAM)(LPCSTR)strBuffer);
   printf(" Text: %s \n\n", strBuffer);

   system("pause"); // Testing blah

   return 0;
}



and i have some questiong concerning this code:
1-How did you know that "DlgGroupChat Window Class" is the class name or class atom
2-same question with "wtl_splitterwindow"
3-i noticed that there is a part of this code not working concerg richedita i tried looking for can in the place of atlaxwin71 and i couldn't find
i appreciate any help
Thanks
mr fox
imFiles Newbie
imFiles Newbie
 
Posts: 3
Joined: Tue Feb 16, 2010 10:55 am

Re: Paltalk get message

Postby Chike » Tue Feb 16, 2010 12:20 pm

Visual Studio's Spy++ or Winspector Spy are the kind of tools to find windows hirarchy, properties and trace messages.
In paltalk 9.8 atlaxwin90 replaces atlaxwin71.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 519
Joined: Sun May 13, 2007 11:20 pm

Re: Paltalk get message

Postby mr fox » Tue Feb 16, 2010 2:31 pm

Thanks Chike for Replying
i couldn't find vs spy++ instead i found winid wich is also useful.
Atlaxwin90 is not working :( i have paltlak 9.8 thought
mr fox
imFiles Newbie
imFiles Newbie
 
Posts: 3
Joined: Tue Feb 16, 2010 10:55 am

Re: Paltalk get message

Postby Chike » Tue Feb 16, 2010 5:57 pm

Run the debugger, find which line fail, check that code still matche windows hirarchy.
roomwind.png
roomwind.png (11.38 KiB) Viewed 179 times
Image
Chike
imFiles Master
imFiles Master
 
Posts: 519
Joined: Sun May 13, 2007 11:20 pm

Re: Paltalk get message

Postby mr fox » Tue Feb 16, 2010 8:54 pm

Hello Chike Thanks For Help!
The problem was with the hierachy now it is working like charm....
this is the hierarchy for paltalk 9.8:
Code: Select all
      HWND parent = FindWindow("DlgGroupChat Window Class", NULL);
   HWND child;
   child = FindWindowEx(parent, 0, "WTL_SplitterWindow", NULL);
   child = FindWindowEx(child, 0, "WTL_SplitterWindow", NULL);
   child = FindWindowEx(child, 0, "WTL_SplitterWindow", NULL);
   child = FindWindowEx(child, 0, "WTL_SplitterWindow", NULL);
   child = FindWindowEx(child, 0, "ATL:00830CB0", NULL);
if(!child)printf("error with child\n");
   HWND atla = FindWindowEx(child, 0, "AtlAxWin90", NULL); 
atla=FindWindowEx(child,atla, "AtlAxWin90", NULL);
if(!atla)printf("error with atla\n");
   atla = FindWindowEx(atla, 0, "#32770", NULL);

   HWND rich20 = FindWindowEx(atla, 0, "RichEdit20A", NULL);
if(!rich20)printf("error with rich20\n");

:)
mr fox
imFiles Newbie
imFiles Newbie
 
Posts: 3
Joined: Tue Feb 16, 2010 10:55 am

Re: Paltalk get message

Postby autopilot » Wed Feb 17, 2010 12:24 am

the code you are using is ok if you want to update it every time Paltalk releases a new version. you would be much better off to learn how to enum the sub windows to find the window handle you are looking for.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 321
Joined: Sun Sep 24, 2006 12:19 am


Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests