mtheriault2000
Well-known Member
- Joined
- Oct 23, 2008
- Messages
- 826
Hello
How can i get my code to use this
My code does not recognise the user32 function
Any help appreciated
Martin
How can i get my code to use this
Rich (BB code):
Public colHandle As New Collection
Public Const WM_CLOSE = &H10
Public Const WM_DESTROY = &H2
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Function fEnumWindowsCallBack(ByVal hwnd As Long, ByVal lpData As Long) As Long
Dim lParent As Long
Dim lThreadId As Long
Dim lProcessId As Long
'
' This callback function is called by Windows (from the EnumWindows
' API call) for EVERY top-level window that exists. It populates a
' collection with the handles of all parent windows owned by the
' process that we started.
' The lpData argument is the process id of the window(s) to be closed.
fEnumWindowsCallBack = 1
lThreadId = GetWindowThreadProcessId(hwnd, lProcessId)
If lpData = lProcessId Then
lParent = GetParent(hwnd)
If lParent = 0 Then
colHandle.Add hwnd
End If
End If
End Function
My code does not recognise the user32 function
Any help appreciated
Martin