Public oIE As Object
Public glPid As Integer
Public glHandle As Integer
Public colHandle As New Collection
Public glHwnd As Integer
Public Const SMTO_BLOCK As Short = &H1s
Public Const SMTO_ABORTIFHUNG As Short = &H2s
Public Const WM_NULL As Short = &H0s
Public Const WM_CLOSE As Short = &H10s
Public Const WM_DESTROY As Short = &H2s
Public Const PROCESS_ALL_ACCESS As Integer = &H1F0FFF
'UPGRADE_ISSUE: Declaring a parameter 'As String' is not supported. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1016"'
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As String) As Integer
Declare Function GetParent Lib "user32" (ByVal hwnd As Integer) As Integer
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Integer, ByVal lParam As Integer) As Integer
Declare Sub ReleaseCapture Lib "user32" ()
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessID As Integer) As Integer
Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA"(ByVal hwnd As Integer, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer, ByVal fuFlags As Integer, ByVal uTimeout As Integer, ByRef pdwResult As Integer) As Integer
Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Integer, ByVal uExitCode As Integer) As Integer
Public Function fEnumWindowsCallBack(ByVal hwnd As Integer, ByVal lpData As Integer) As Integer
Dim lParent As Integer
Dim lThreadId As Integer
Dim lProcessId As Integer
fEnumWindowsCallBack = 1
lThreadId = GetWindowThreadProcessId(hwnd, lProcessId)
If glPid = lProcessId Then
glHwnd = hwnd
fEnumWindowsCallBack = 0
lParent = GetParent(hwnd)
If lParent = 0 Then
colHandle.Add(hwnd)
End If
Else
End If
End Function
Public Function fEnumWindows() As Boolean
Dim hwnd As Integer
'UPGRADE_WARNING: Add a delegate for AddressOf fEnumWindowsCallBack Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'
Call EnumWindows(AddressOf fEnumWindowsCallBack, hwnd)
End Function