Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

javaControl

Browsing clsWindowEnum.cls (1.58 KB)

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsWindowEnum"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

' clsWindowEnum: top level window enumeration interface
'
' Copyright (c) 2008 JaviteSoft ( http://www.javitesoft.com )

Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long

Private m_WindowObj As Object
Private m_WindowHandles As Collection
Private m_Index As Long
Private m_Count As Long

Friend Sub Init(ByVal WindowObj As clsWindowController)

    Set m_WindowObj = WindowObj
    Set m_WindowHandles = New Collection
    m_Count = 0
    m_Index = 0
    
    EnumWindows AddressOf EnumWindowsProc, Me
    
End Sub

Public Function Count() As Long
    Count = m_WindowHandles.Count
End Function

Public Function NextWindow() As Boolean

    m_Index = m_Index + 1
    If m_Index <= Me.Count Then
        NextWindow = True
    Else
        NextWindow = False
    End If

End Function

Public Function GetWindow() As clsWindowController

    Dim thisWindow As New clsWindowController
    Set GetWindow = thisWindow.InitByHandle(m_WindowHandles(m_Index))
    
End Function

Friend Sub AddHandle(ByVal hWnd As Long)
    m_WindowHandles.Add hWnd
End Sub

Public Sub EndEnum()
    m_WindowObj.EndWindowEnum Me
End Sub

Download clsWindowEnum.cls

Back to file list


Back to project page