Skip to content
Home > Programming > vb6 Send text to any pal version

vb6 Send text to any pal version

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #187858
    autopilot
    Member

    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

    #187882
    Admin
    Administrator

    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 🙂

    #187881

    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?

    #187880
    Chike
    Member

    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:

    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.

    #187879
    Girly Girl
    Member

    Chike 😳
    nice and gentel
    can u update the source and add ( text size & text color ) coz the send text its same size and color 😀

    #187878
    String
    Member

    One way might be, to add a richtextbox control to your project. Style the text within as you like and send it.

    #187877
    autopilot
    Member

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

    #187876
    Admin
    Administrator

    🙂 let me check this out ehheh 😀
    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:

    #187875
    autopilot
    Member

    @Admin 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 👿

    #187874

    @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:

    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.

    #187873

    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.

    #187872
    String
    Member

    Basically the same way you send it.
    Note the following function in your example from autopilot.

    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.

    #187871
    autopilot
    Member

    string you handle the gerber like an expert 🙂

    #187870
    String
    Member

    Well, the strained peaches were always my favorite 🙂

    #187869
    method
    Member

    @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

Viewing 15 posts - 1 through 15 (of 25 total)
  • You must be logged in to reply to this topic.