Camfrog CTreeViewTS chat member list

This topic contains 5 replies, has 4 voices, and was last updated by  James 1 week, 2 days ago.

  • Author
    Posts
    1 Star2 Stars3 Stars4 Stars5 Stars Rate it First!
  • #69317
    Member
    Posts: 2

    I’m stumped. I’ve been trying to get a list of the chatroom members from a Camfrog chatroom for over a week now, to no avail. Any help is appreciated!

    ”” VB.NET ””

    <System.Runtime.InteropServices.DllImport(“user32.dll”, SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)>
    Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, ByVal childAfter As IntPtr, ByVal lclassName As String, ByVal windowTitle As String) As IntPtr
    End Function

    Declare Auto Function FindWindow Lib “user32.dll” (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr

    find objects starting with public lobby chatroom. The title may need to be changed to get the first hWnd.
    Dim hWnd As IntPtr = FindWindow("#32770", "Camfrog: Video Chat Room") '
    If hWnd = 0 Then
    MsgBox("The video chat room does not exist.")
    End
    End If
    Dim hwndObject0 As Long = FindWindowEx(hWnd, IntPtr.Zero, "#32770", "")
    Dim hwndObject1 As Long = FindWindowEx(hWnd, hwndObject0, "#32770", "")
    Dim hwndObject2 As Long = FindWindowEx(hWnd, hwndObject1, "#32770", "")
    Dim hwndObject3 As Long = FindWindowEx(hwndObject2, IntPtr.Zero, "CSplitterCtrlsTS", "")
    Dim hwndObject4 As Long = FindWindowEx(hwndObject3, IntPtr.Zero, "CSplitterCtrlsTS", "")
    Dim ListhWnd As Long = FindWindowEx(hwndObject4, IntPtr.Zero, "CTreeViewTS", "") 'Here is the TreeView.

    #69321
    Member
    Posts: 25

    Instead of getting the list of CSplitterCtrlsTS in CF, refer to its real-time counting @ the top of the users list in a room

    #69339
    Administrator
    Posts: 442

    Your code above is not enough. You need a custom Treeview class or module. I am a bit busy right now to create one. See if you can create your own or find one out there.

    #71585
    Member
    Posts: 15

    i’m currently working on this. stay tuned. 🙂

    #71589
    Member
    Posts: 15
    Private Function GetTreeviewHandlesFrom(ByVal hwnd As IntPtr) As List(Of IntPtr)
            TVList.Clear()
            EnumChildWindows(hwnd, AddressOf EnumChildWindowProc, &H0)
            Return TVList
        End Function
    
        Private Function EnumChildWindowProc(ByVal hwnd As IntPtr, ByVal lParam As Integer) As Integer
            Dim cn As New StringBuilder(255)
            GetClassNameW(hwnd, cn, 255)
            If cn.ToString.ToLower.ToLower.Contains("systreeview32") Then 'Make sure the child window is a Treeview before adding its handle to the List
                TVList.Add(hwnd)
            End If
            Return 1
        End Function
    
        <DllImport("user32.dll", EntryPoint:="FindWindowW")> _
        Private Shared Function FindWindowW(<MarshalAs(UnmanagedType.LPTStr)> ByVal lpClassName As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal lpWindowName As String) As IntPtr
        End Function
    
        <DllImport("user32.dll", EntryPoint:="GetClassNameW")> _
        Private Shared Function GetClassNameW(ByVal hWnd As IntPtr, <MarshalAs(UnmanagedType.LPWStr)> ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
        End Function
    
        Private Delegate Function EnumCallBackDelegate(ByVal hwnd As IntPtr, ByVal lParam As Integer) As Integer
    
        <DllImport("user32.dll", EntryPoint:="EnumChildWindows")> _
        Private Shared Function EnumChildWindows(ByVal hWndParent As System.IntPtr, ByVal lpEnumFunc As EnumCallBackDelegate, ByVal lParam As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
        End Function
    #71643
    Member
    Posts: 15

You must be logged in to reply to this topic.