Skip to content

TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #187477
    TWiZA
    Member

    Hi

    Private Delegate Function EnumWin(ByVal HwD As Integer, ByVal lparam As Integer) As Boolean
    Private Declare Function EnumWindows Lib "user32.dll" Alias "EnumWindows" (ByVal FuncCall As EnumWin, ByVal lParam As Integer) As Boolean
    Private Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Integer, ByVal FuncCall As EnumWin, ByVal lParam As Integer) As Boolean
    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal HwnD As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer
    
    Private Function FindRooms(ByVal HwD As Integer, ByVal lparam As Integer) As Boolean
    
    Dim sClass As String = Space(255)
    Dim nC As Integer = GetClassName(HwD, sClass, 255)
    Dim WinTxt As String
    
    sClass = Left(sClass, nC)
    
    If sClass = "DlgGroupChat Window Class" Then
    WinTxt = sGetText(HwD)
    If WinTxt.Contains(" Voice Room") Then
    
    End If
    End If
    
    Return True
    End Function
    
    Private Function FindHwndCTL(ByVal HwD As Integer, ByVal lparam As Integer) As Boolean
    
    Dim sClass As String = Space(255)
    Dim nC As Integer = GetClassName(HwD, sClass, 255)
    Static i As UShort
    
    sClass = Left(sClass, nC)
    
    If sClass = "SysListView32" Then _listHWD = HwD
    If sClass = "RichEdit20A" Then
    i += 1
    If i = 3 Then _sendHWD = HwD
    If i = 4 Then _textHWD = HwD : i = 0 : Return False : Exit Function
    End If
    
    Return True
    End Function
    
    EnumWindows(New EnumWin(AddressOf FindRooms), 0)
    EnumChildWindows(HwD, New EnumWin(AddressOf FindHwndCTL), 0)

     

    #187481
    AhFox
    Member

    this is very nice bro !!! :vexxler:

    #187480
    Chike
    Member

    However there are several flows in the code.
    First, the callback by no means reaturns “Boolean” which its size is machine implementation dependent. It is a 32 bit integer.
    Second, lParam should be the size of pointer, for 32bit integer works, for 64bit it won’t, beter make it ByRef.
    Also, the purpose of lParam is to enable passing a user defined data to the callback (normaly ByRef) which is the right way to implement it and more relieble as the static UShort that is used in FindHwndCTL may be left in a bad state, and sure is prefered over using global variables.

    #187479
    TWiZA
    Member

    Remarks tooken in consideration, Thanks
    I will edit later, anyway the code works good on win xp

    #187478
    AhFox
    Member

    You guys are great !!! Cool …

    I’m trying to get used to C# … because C# is more like JAVA. (JAVA style is great).

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