EnumWindows Problem
Can you help?
Thanks!!
Here is my code
======================================
'''
'Windows API Function Declarations
''
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
'''''
'Here is the point where the error occurs:
'''''
vEnumRet = EnumWindows(AddressOf EnumWindowsProc, ByVal 0&)
'''''
'here is my callback:
'''''
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim sSave As String, Ret As Long
Ret = GetWindowTextLength(hwnd)
sSave = Space(Ret)
GetWindowText hwnd, sSave, Ret + 1
Debug.Print Str$(hwnd) + " " + sSave
'continue enumeration
EnumWindowsProc = True
End Function

