Article ID: 192257
Article Last Modified on 5/13/2003
AddressOf MyModule.MyFunc
instead of:
AddressOf MyFunc
Declare Function EnumChildWindows Lib "user32" ( _
ByVal hWndParent As Any, ByVal lpEnumFunc As Long, _
ByVal lParam As Long) As Long
Declare Function FindWindowEx Lib "user32" Alias _
"FindWindowExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Dim m_hWnd As Long
Public Function EnumWindowProc(ByVal hWnd As Long, _
ByVal lParam As Long) As Long
Dim nRet As Long
nRet = FindWindowEx(hWnd, 0, "VbaWindow", "Immediate")
If nRet Then
m_hWnd = nRet
EnumWindowProc = False
Else
Call EnumChildWindows(hWnd, AddressOf EnumWindowProc, 0)
EnumWindowProc = (m_hWnd = 0)
End If
End Function
Call EnumChildWindows(hWnd, AddressOf Module1.EnumWindowProc, 0)
Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbVBp600 kbNoKeyWord
Keywords: kbprb KB192257