Looking for code that reads paltalk user names on entry

You can talk about VB programming here

Looking for code that reads paltalk user names on entry

Postby method » Wed Apr 01, 2009 5:49 am


Hi all .Could any one point me to the source code that only reads user names when user enter the room . I am sure the code was part of one of bigger project here but i cant find it. I am looking for a code that is effective in busy rooms where the texts scroll rapidly.
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: Looking for code that reads paltalk user names on entry

Postby String » Wed Apr 01, 2009 2:59 pm

-= Please ask your questions in the forum, not in pm.
String
imFiles Senior
imFiles Senior
 
Posts: 313
Joined: Mon Mar 10, 2008 7:06 am
Location: IDE

Re: Looking for code that reads paltalk user names on entry

Postby Chike » Wed Apr 01, 2009 3:54 pm

Subclassing the control makes it easy
Code: Select all
LRESULT
APIENTRY UserListProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
   WNDPROC wndprocPrev = get_prev_wndproc(hwnd);
   switch (uMsg) {
   case LVM_DELETEITEM:
      break;
   case LVM_SETITEM: {
         LVITEM *pLVItem = (LVITEM*) lParam;
         user_entered(pLVItem->pszText);
      }
      break;
   default:
      ;
   }
   return CallWindowProc(wndprocPrev, hwnd, uMsg, wParam, lParam);
}

No scrolling text effects, never miss a name that's on the list.
I did suggest once a methid to reduce loss of lines retrived from text. It's not full proof unless you clear the text every once in a while, because after some time the text is being cut from the top and there's no way to tell how much exactly (unless you subclass the text control, then you can tell exactly how much is deleted) simple code too
Code: Select all
      case EM_REPLACESEL:
         if (*LPCSTR(lParam) == 0) {
            DWORD start_sel = 0, end_sel = 0;
            CallWindowProc(wndprocPrev, hwnd, EM_GETSEL,
                        WPARAM(&start_sel), LPARAM(&end_sel));
            if (start_sel == 0 && end_sel > 0) {
               last_index -= end_sel;
            }
         }
         break;
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: Looking for code that reads paltalk user names on entry

Postby NVYE » Wed Apr 01, 2009 10:00 pm

this looks interesting... any chance in VB.NET or C# ?
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm

Re: Looking for code that reads paltalk user names on entry

Postby method » Thu Apr 02, 2009 1:42 am

Thanks all for replies. String i looked at that project but it is not working with paltalk 9.6 build 313 .chike i wish i knew about subclassing ...

The following code used to work but not now. Could any one tell me part should i change to make it work? I tried to use PAT or Jk's spy 5.1 code generator but still i get zero for "MsgBox test & xxxxxxxxxxx"!! Hope you guys help me .Looking forward for replies.Thanks

Code: Select all
Function GetChatText(ByVal room As String)
On Error Resume Next
Dim atla As Long
Dim atlaxwin As Long
Dim X As Long
Dim richedita As Long
Dim Button As Long



     
            Dim xx As Long
Dim xxx As Long
Dim xxxx As Long
Dim xxxxx As Long
Dim xxxxxx As Long
Dim xxxxxxx As Long
Dim xxxxxxxx As Long
Dim xxxxxxxxx As Long
Dim xxxxxxxxxx As Long
Dim xxxxxxxxxxx As Long
Dim xxxxxxxxxxxx As Long
Dim xxxxxxxxxxxxx As String
           
           

mywindowclass = FindWindow("DlgGroupChat Window Class", room)


        xx = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
xxx = FindWindowEx(xx, 0&, "wtl_splitterwindow", vbNullString)
xxxx = FindWindowEx(xxx, 0&, "wtl_splitterwindow", vbNullString)
xxxxx = FindWindowEx(xxxx, 0&, "wtl_splitterwindow", vbNullString)
xxxxxx = GetWindow(xxxxx, GW_CHILD)
xxxxxxx = GetWindow(xxxxxx, GW_HWNDNEXT)
xxxxxxxx = FindWindowEx(xxxxxxx, 0&, "atlaxwin71", vbNullString)
xxxxxxxxx = FindWindowEx(xxxxxxx, xxxxxxxx, "atlaxwin71", vbNullString)
xxxxxxxxxx = FindWindowEx(xxxxxxxxx, 0&, "#32770", vbNullString)
xxxxxxxxxxx = FindWindowEx(xxxxxxxxxx, 0&, "richedit20a", vbNullString)


GetChatText = GetRoomText(xxxxxxxxxxx) 'getlastlinecontroltext(richedita)

MsgBox test & xxxxxxxxxxx
End Function
Function GetRoomText(Ihwnd As Long) As String
    Dim Textlen As Long
    Dim Text As String
    Textlen = SendMessage(Ihwnd, WM_GETTEXTLENGTH, 0, 0)
    If Textlen = 0 Then
        GetRoomText = "Enter a Room"
        Exit Function
    End If
    Textlen = Textlen + 1
    Text = Space$(Textlen)
    Textlen = SendMessage(Ihwnd, WM_GETTEXT, Textlen, ByVal Text)
    GetRoomText = Left$(Text, Textlen)
End Function
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: Looking for code that reads paltalk user names on entry

Postby Chike » Thu Apr 02, 2009 5:31 am

NVYE wrote:this looks interesting... any chance in VB.NET or C# ?

This code run in paltalk process, so VB.NET or C# are not the languages for the task.
It can be used by and comunicate with a VB.NET or C# application.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: Looking for code that reads paltalk user names on entry

Postby NVYE » Thu Apr 02, 2009 10:53 am

This code run in paltalk process, so VB.NET or C# are not the languages for the task.
It can be used by and comunicate with a VB.NET or C# application.


Sounds like a class library in C++. If you don't mind can you upload the dll file and show us how to use it.

I have a very lack knowledge on C++ for the WIN processes hooking. I'm wondering is it comparable with WIN32 and 64 bit ? thanks
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm

Re: Looking for code that reads paltalk user names on entry

Postby Chike » Thu Apr 02, 2009 11:39 am

NVYE wrote:Sounds like a class library in C++. If you don't mind can you upload the dll file and show us how to use it.

I have a very lack knowledge on C++ for the WIN processes hooking. I'm wondering is it comparable with WIN32 and 64 bit ? thanks

Not a class library, but API to comunicate with paltalk.
At it's current state it would be a bit complex to use in basic. It uses callbacks to send messages from paltalk to the application. The messages are sent over pipes and recived in a differe native thread and require delegates co be sent to the form.
I can make a simpler DLL that will comunicate using EM_COPYDATA and will be much easier to use in VB.NET
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: Looking for code that reads paltalk user names on entry

Postby NVYE » Thu Apr 02, 2009 4:45 pm

What is the performance for this API do you know? Is it any faster than using the regular get Text?
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm

Re: Looking for code that reads paltalk user names on entry

Postby method » Thu Apr 02, 2009 6:13 pm

NVYE can you show me a working example of get Text for paltalk 9.6 build 313 and a way to send text too room too ? All old methods stoped working !!
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: Looking for code that reads paltalk user names on entry

Postby Chike » Thu Apr 02, 2009 6:52 pm

Of course it's faster, let alone reliable. To begin with, t doesn't poll, everything is done only when needed.
At most there is one context awitch and data copy between processes per event.
Paltalk send over 50 messages to insert of one line in text, current code use 6 to retrive it so it's not more then 10% overhead to paltalk which is by itself very little.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: Looking for code that reads paltalk user names on entry

Postby NVYE » Thu Apr 02, 2009 10:25 pm

method, if you use Paltalk integration from autopilot ... it is working fine. He also provided you with source code. Make sure you check it out. It contained a bunch of useful information. I'm currently using his library for some of my programs.
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm

Re: Looking for code that reads paltalk user names on entry

Postby method » Thu Apr 02, 2009 10:52 pm

NVYE wrote:method, if you use Paltalk integration from autopilot ... it is working fine. He also provided you with source code. Make sure you check it out. It contained a bunch of useful information. I'm currently using his library for some of my programs.


Thanks for suggesting that..Could you point me to which one you are refaring ? I tried a few non worked !!
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: Looking for code that reads paltalk user names on entry

Postby NVYE » Fri Apr 03, 2009 10:36 am

Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests