- This topic has 5 replies, 4 voices, and was last updated 1 year ago by
James.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
February 9, 2017 at 6:37 am #69317
brad
MemberI’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.
February 12, 2017 at 2:54 pm #69321Mytacism
MemberInstead of getting the list of CSplitterCtrlsTS in CF, refer to its real-time counting @ the top of the users list in a room
February 17, 2017 at 11:51 am #69339ChiNa
AdministratorYour 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.
January 31, 2019 at 5:19 pm #71585James
Memberi’m currently working on this. stay tuned. 🙂
January 31, 2019 at 6:06 pm #71589James
MemberPrivate 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
February 4, 2019 at 12:56 pm #71643 -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.