Hi,
I'm trying to get all the child windows for an application (inc. child of child) but I'm getting really confused using GetWindows and loops as it's only returning the first level of child windows. I'm sure I'm just been a total dunce :drunk: there must be a simply solution. Current code...
Many thanks,
M
I'm trying to get all the child windows for an application (inc. child of child) but I'm getting really confused using GetWindows and loops as it's only returning the first level of child windows. I'm sure I'm just been a total dunce :drunk: there must be a simply solution. Current code...
VB.NET:
lHwndDesktop = GetDesktopWindow()
lHwndParent = GetWindow(lHwndDesktop, GW_CHILD)
Do While lHwndParent.ToInt32 > 0
GetClassName(lHwndParent, sFoundClassName, sFoundClassName.Capacity)
If sFoundClassName.ToString.Trim = "WindowsForms10.Window.8.app.0.218f99c" Then
lHwndChild = GetWindow(lHwndParent, GW_CHILD)
Do While lHwndChild.ToInt32 > 0
GetWindowText(lHwndChild, sWindowTitle, 255)
MsgBox(sWindowTitle.ToString.Trim)
lHwndChild = GetWindow(lHwndChild, GW_HWNDNEXT)
Loop
End If
lHwndParent = GetWindow(lHwndParent, GW_HWNDNEXT)
Loop
M