Date: 02-16-2022
Return to Index
created by gbSnippets
'This code enumerates only child windows.
'Primary Code:
'The EnumberateChildren API is the basis for the code.
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
Global wList(), iCount as Long
Function PBMain() As Long
ReDim wList(5000)
EnumerateChildren GetDeskTopWindow
? str$(iCount)
End Function
Sub EnumerateChildren(hWndParent As Long)
Local hWndChild As Long, xRes As String
Incr iCount
hWndChild = GetWindow(hWndParent, %GW_CHILD OR %GW_HWNDFIRST)
Do While hWndChild <> 0
wList(iCount) = hWndChild
EnumerateChildren hWndChild
hWndChild = GetWindow(hWndChild, %GW_HWNDNEXT)
Loop
End Sub
'gbs_01089
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm