vb6 Send text to any pal version

You can talk about VB programming here

vb6 Send text to any pal version

Postby autopilot » Thu Jun 07, 2007 5:14 pm


In this project, I check the version of pal that is installed and then am able to set up variables based on the version. It does not use ATL so it does not need to be updated with every update of the Pal client.

Take it, use it, change it as you see fit.

autopilot
Attachments
SendTextAnyPalVerAutoDetect.zip
send text to any pal version
(13.73 KiB) Downloaded 452 times
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Postby locohacker » Thu Jun 07, 2007 6:00 pm

man ya like readin peeps mind, i was gona try ya code for the new funtext update :)
Thanks ya made it a lot easier for me :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: vb6 Send text to any pal version

Postby intercepter_3 » Thu Nov 22, 2007 5:13 pm

This is awsome.

I am slightly confused as to how to take one step back in the index and get the chat window so can read text. Any suggestions?
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Re: vb6 Send text to any pal version

Postby Chike » Thu Nov 22, 2007 8:15 pm

I have found that the text window has unique attributes that identify it.
It is the only RichEdit20A class that is visible, has no OleDrop propertirs, and has WS_EX_NOPARENTNOTIFY extended style.

My code in C (sould be easy to port to basic) look like this:
Code: Select all
      static BOOL CALLBACK EnomRoomTextProps(HWND hwnd, LPCTSTR szProp, HANDLE)
      {
         char atom_name[64];
         //OleDropTargetInterface
         //OleDropTargetMarshalHwnd
         if (is_atom(szProp)) {
            ATOM atom = LOWORD(szProp);
            if (!GetAtomName(atom, atom_name, sizeof(atom_name)))
               return FALSE;
            szProp = atom_name;
         }
         if (!strncmp(szProp, "OleDrop", 7)) {
            SetLastError(0);
            return FALSE;
         }
         return TRUE;
      }
   static BOOL CALLBACK FindRoomTextProc(HWND hwnd, LPARAM lParam)
   {
      TCHAR str[128];
      if (RealGetWindowClass(hwnd, str, sizeof(str)) == 0)
         return TRUE;
      if (strcmp(str, "RichEdit20A"))
         return TRUE;
      if (!IsWindowVisible(hwnd))
         return TRUE;
      if (!EnumProps(hwnd, EnomRoomTextProps))
         return TRUE;
      if ((GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_NOPARENTNOTIFY) == 0)
         return TRUE;
      *((HWND *)lParam) = hwnd;
      SetLastError(0);
      return FALSE;
   }

//...

   HWND rich20;
   if (EnumChildWindows(hwnd, (WNDENUMPROC)FindRoomTextProc,
                     PtrToLong(&rich20)) ||
         GetLastError() != 0) {
      // could not find room text
      return;
   }
// do whatever with rich20 here


Note that "failur" of EnumChildWindows actually indicats sucess (combined with GetLastError() return of 0)
For those who have diffuculties reading C:
hwnd is the room HWND, EnumChildWindows get the address of rich20 as lParam to FindRoomTextProc callback.
When the callback identify the window, it puts the hwind in the addres that was sent to it, set last error to zero, and returns false (zero in basic), which cuase the enumeration to "fail".
If the enumeration succeeds it means it hasn't found the room text.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 581
Joined: Sun May 13, 2007 6:20 pm

Re: vb6 Send text to any pal version

Postby Girly Girl » Sat Jun 14, 2008 7:19 pm

Chike :oops:
nice and gentel
can u update the source and add ( text size & text color ) coz the send text its same size and color :D
Girly Girl
 
Posts: 2
Joined: Sat Jun 14, 2008 6:40 pm

Re: vb6 Send text to any pal version

Postby String » Sun Jun 15, 2008 1:16 am

One way might be, to add a richtextbox control to your project. Style the text within as you like and send it.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: vb6 Send text to any pal version

Postby autopilot » Mon Aug 25, 2008 4:48 pm

Here is an update...
Pal 9.4 and up, we had to switch how we found the handle of the control.
Attachments
SendTextAnyPalVerAutoDetectUpdate.zip
update
(13.94 KiB) Downloaded 179 times
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: vb6 Send text to any pal version

Postby locohacker » Tue Aug 26, 2008 7:29 am

:) let me check this out ehheh :D
Hey in your opinion will it be an easy update for the programs, I am lzy asz hell cause of school starting now hehehe :mrgreen:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Re: vb6 Send text to any pal version

Postby autopilot » Tue Aug 26, 2008 10:38 am

locohacker wrote:I am lzy asz hell cause of school starting now hehehe :mrgreen:


whatcha mean... "cause school starting"? That aint why yer lazy!!!!!!!!!!! hehehehe

pm me the a1 code for one of the apps and I will update it to a2 (fix it)... then you can see the change and update the other a1 apps :evil:
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: vb6 Send text to any pal version

Postby intercepter_3 » Tue Feb 17, 2009 2:28 pm

autopilot wrote:Here is an update...
Pal 9.4 and up, we had to switch how we found the handle of the control.

Autopilot,

Finally getting around to using this code. And I am having one problem. I am getting an error message.

This is where I get the error:
Code: Select all
Private Function getSubForm(ByVal hWnd As Long, _
    ByVal TargetSubClass As String, _
    ByVal TargetSubClassIndex As Integer) As Long
    'set variables in module
    mParentHnd = hWnd
    mTargetSubClass = TargetSubClass
    mTargetSubClassIndex = TargetSubClassIndex
    'set variables for EnumWindows function
    Dim lRet As Long
    Dim lParam As Long
    'Enum sub windows to get hnd for target
    lRet = FindSubWindsWithwHnd
    'return target hnd
    getSubForm = mSubFormHnd
    End Function


I get a Compile error "Expected Function or Variable" and it highlights FindSubWindsWithwHnd

When I go to that function, it is just declared as a sub. I am just using your sample project to get familiar with your changes for 9.4 of pal and up.

Is there something I am missing here?

I have vb6 and am on a 9.5 ver of pal.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Re: vb6 Send text to any pal version

Postby intercepter_3 » Tue Feb 17, 2009 5:19 pm

And I got that to work just fine by changing it to a public function and it works like a charm.

Anyone have any ideas on the autopilot method to get text?

I did a search and could not find anything.
intercepter_3
imFiles Newbie
imFiles Newbie
 
Posts: 23
Joined: Sat Feb 11, 2006 3:02 am

Re: vb6 Send text to any pal version

Postby String » Tue Feb 17, 2009 6:17 pm

Basically the same way you send it.
Note the following function in your example from autopilot.
Code: Select all
Private Function ReadTextHnd


This gives you the room text handle. You can then write a function to get the last line of text or whatever you need.
You could easily write your own "get room text" function, or you can find an example in loco's AdminBot source.
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: vb6 Send text to any pal version

Postby autopilot » Thu Feb 19, 2009 1:21 am

string you handle the gerber like an expert :)
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Re: vb6 Send text to any pal version

Postby String » Thu Feb 19, 2009 1:42 am

Well, the strained peaches were always my favorite :)
String
imFiles Senior
imFiles Senior
 
Posts: 282
Joined: Mon Mar 10, 2008 7:06 am

Re: vb6 Send text to any pal version

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

intercepter_3 wrote:And I got that to work just fine by changing it to a public function and it works like a charm.

Anyone have any ideas on the autopilot method to get text?

I did a search and could not find anything.


intercepter can tell me how you made autopilot code work. I tried it with paltalk 9.6 build 313 and i get same error. Did you manage to read last line from the rooom too ? Looking forward for your reply.Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Next

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests