TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

You can talk about VB programming here

TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Postby TWiZA » Wed Nov 12, 2008 3:14 pm


Hi
Code: Select all
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)

TWiZA
imFiles Newbie
imFiles Newbie
 
Posts: 39
Joined: Wed Jul 16, 2008 11:15 am

Re: TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Postby NVYE » Sat Nov 15, 2008 3:50 pm

this is very nice bro !!! :vexxler:
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm

Re: TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Postby Chike » Sat Nov 15, 2008 5:16 pm

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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Postby TWiZA » Sat Nov 15, 2008 6:25 pm

Remarks tooken in consideration, Thanks
I will edit later, anyway the code works good on win xp
TWiZA
imFiles Newbie
imFiles Newbie
 
Posts: 39
Joined: Wed Jul 16, 2008 11:15 am

Re: TWiZA Rooms/Controls Handles 9.2/9.4/9.5 source

Postby NVYE » Mon Nov 17, 2008 6:08 pm

You guys are great !!! Cool ...

I'm trying to get used to C# ... because C# is more like JAVA. (JAVA style is great).
Add-on Bots for educational and amusement purposes:
http://www.vnfox.com

Website:
http://www.asktechguy.com
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 234
Joined: Fri Jun 10, 2005 11:29 pm


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests