Skip to content

Quick way to find paltalk room handles

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #186584
    Chike
    Member

    I have just realized all the controls have control ID. There are duplicates but those I have seen are invisible which makes it easy.
    Works on build 474, and should work on older and newer builds.

    Public Delegate Function EnumWChildindowaProc(ByVal Handle As IntPtr, ByRef Parameter As IntPtr) As Boolean
    Public Declare Auto Function EnumChildWindows Lib "User32.dll" _
    (ByVal hwnd As IntPtr, ByVal Callback As EnumWChildindowaProc, ByRef lParam As IntPtr) As Boolean
    
    Declare Auto Function GetDlgCtrlID Lib "User32.dll" _
    (ByVal hwnd As IntPtr) As Integer
    
    Public Function EnumFindID(ByVal hwnd As IntPtr, ByRef lParam As IntPtr) As Boolean
    If (GetDlgCtrlID(hwnd) = lParam) And IsWindowVisible(hwnd) Then
    lParam = hwnd
    Return False
    End If
    Return True
    End Function
    
    Sub main()
    Dim hwnd = FindWindow("DlgGroupChat Window Class", vbNullString)
    Dim ctl = &H6FD
    EnumChildWindows(hwnd, AddressOf EnumFindID, ctl)
    Console.WriteLine("user names: " & ctl.ToString("X8"))
    ctl = &HCA
    EnumChildWindows(hwnd, AddressOf EnumFindID, ctl)
    Console.WriteLine("room text: " & ctl.ToString("X8"))
    ctl = &HCB
    EnumChildWindows(hwnd, AddressOf EnumFindID, ctl)
    Console.WriteLine("user edit: " & ctl.ToString("X8"))
    End Sub

     

    /edit: I have checked and it works on build 403

    #186596
    autopilot
    Member

    Nice find and thanks for sharing!

    #186595
    Chike
    Member

    I have always used EnumChildWindows to find romm text edit and user list, but by other properties not by control ID. The reason is probably that in WinspectorSpy I was using back then it wasn’t conspicuous as it is in WinSpy I have used now.

    On a side note: If you don’t wish to use the lParam, the delegate can point to a non-shared method of a class and in that the reference to the class is passed. though it better be a class designed to this spesific task and not your form or application as using global variables is not a good practice.

    #186594
    ChiNa
    Administrator

    Thanks for sharing Chike!

    #186593
    Departure
    Member

    …………………………………………….

    #186592
    ChiNa
    Administrator

    @I missed this Part , Sorry about that Chike…

    Since I am very new to Enum methods I have been on pinvoke.net for months learning about enumchild and enumproc. Right now I cant get the “users list” Win Handle from Window “ATL:00AD6190” with your Method Above. The ID’s that I am getting is not working with the function I am using.

    So it means I will have to use the regular Window Handle ID of “ATL:00AD6190” Window on Build 545.
    If I could get get some assistance figuring out how to get Child Window Handle ID’s of an Active Window Automatically could be awesome. thanks a lot in advance..

    #186591
    Chike
    Member

    @ChiNa-Man wrote:

    Right now I cant get the “users list” Win Handle from Window “ATL:00AD6190” with your Method Above. The ID’s that I am getting is not working with the function I am using.

    What are you talking about?
    Change your code as below and tell me ctl is not the exact same as the constant you returning

    Public ReadOnly Property Status() As IntPtr
    Get
    Dim ctl As IntPtr = &H6FD
    EnumChildWindows(hwnd, AddressOf EnumFindID, ctl)
    Return 69282 'Win Handle
    End Get
    End Property
    #186590
    ChiNa
    Administrator

    I did ALMOST the same, Now I know what I did wrong…. 🙁

    I was using FindWindowEx and was looking for the “ATL:” Win Class, instead of using FindWindow and “DlgGroupChat Window Class”! Thanks Chike, It worked now….

    #186589
    cyberpunk
    Member

    Chike,

    Does this work on the latest build? And before I waste your time trying to figure out what I might be doing wrong, does this code allow automatic enumeration of control handles (read Text, send Text, and userlist?) I recently updated Paltalk and naturally my program is having trouble accessing the userlist but has no issue accessing the Read Text and Send Text controls. I know I can run APISpy and get the new handle and edit my code, but I would like to offer my Mic Timer program for others to use real soon. So I decided now is the time to try and learn how to enumerate Windows and I stumbled on this thread. Obviously, if my program “breaks” everytime Paltalk is updated it will not be very useful to anyone but me.

    #186588
    Chike
    Member

    @ManicMike wrote:

    does this code allow automatic enumeration of control handles (read Text, send Text, and userlist?)

    This is exactly what it does, and have been tested with latest paltalk back to even non-working versions (that force upgrade).

    @ManicMike wrote:

    I recently updated Paltalk and naturally my program is having trouble accessing the userlist

    That is due privilige issues, pal runs under different account, make your program run as admin or highest available in manifest

    #186587
    cyberpunk
    Member

    This is exactly what it does, and have been tested with latest paltalk back to even non-working versions (that force upgrade).

    Excellent, I just didn’t want to waste your time if I misunderstood what the code was supposed to do or if Paltalk had somehow prevented it from working. So that just leaves me clearly doing something wrong. To simplify things I have added your code to the declaration area of loco’s Admin Bot code that is available in this forum, then copied over code that builds a listbox of all the users names from my app and added it to the On Click event of a button. When I run the Admin bot the read text works just fine as does the send text, but I can’t get the list of users. Like I said I am intentionally not updating the ATL: xxxxxxx info that has changed from the update because it is my understanding this will no longer be necessary with your code. My question is should I have edited the NicListClass in some way ( it still has the previous ATL info from the last version I was using) or perhaps Remove the NicListClass entirely now? I doubt removal is the answer, and I realize doing that would require editing any place that NicListClass was called as well. I just have to assume I am not doing something that someone with more knowledge would intuitively know to do.

    That is due privilige issues, pal runs under different account, make your program run as admin or highest available in manifest

    I am running my app as Administrator. I suspect, the issue lies in my lack of understanding of exactly what goes on during this process. I mean I can see how we are supplying Class and Handle info but the truth is I am still not sure how it is all collected. I was hoping working with your code things would become more clear to me, but so much is clearly going on to find the Window information than I even imagined. How you guys figured this stuff out amazes me.

    #186586
    Chike
    Member

    I’ve updated the bot code a while ago it should have these changes and AFAIK it works

    #186585
    cyberpunk
    Member

    Okay Chike, thanks anyway. I am using the latest version of code I have access to and I see what seems to be talk about you adding those corrections in that same thread I downloaded it from. i downloaded the ZIP file you offered to Johnny5 in this thread.

    It is cool. I know how to make my timer work for me, was just hoping to upload the executable for others to use.
    I appreciate you taking the time to respond.

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