first of all, thank you for responding. I think I asked the wrong question first. Now, as for the code, it doesn't return anything useful in this case.
Code: Select all
If OpenWindow(1, 100, 200, 195, 260, "1", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
OpenWindow(2, 200, 200, 195, 260, "2", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, WindowID(1))
OpenWindow(3, 300, 200, 195, 260, "3", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, WindowID(2))
win1 = WindowID(1)
win2 = WindowID(2)
win3 = WindowID(3)
; How do I know If Window 1 has a child window?
; How do I know if Window 2 has a main window or parent window?
Debug "win1 "+win1
Debug "win2 "+win2
Debug "win3 "+win3
Debug ""
Debug "win1 1 "+GetAncestor_(win1,1)
Debug "win2 1 "+GetAncestor_(win2,1)
Debug "win3 1 "+GetAncestor_(win3,1)
Debug ""
Debug "win1 2 "+GetAncestor_(win1,2)
Debug "win2 2 "+GetAncestor_(win2,2)
Debug "win3 2 "+GetAncestor_(win3,2)
Debug ""
Debug "win1 3 "+GetAncestor_(win1,3)
Debug "win2 3 "+GetAncestor_(win2,3)
Debug "win3 3 "+GetAncestor_(win3,3)
Debug ""
Debug "win1 w "+GetWindow_(win1,#GW_CHILD)
Debug "win2 w "+GetWindow_(win2,#GW_CHILD)
Debug "win3 w "+GetWindow_(win3,#GW_CHILD)
Debug IsChild_(win1, win2)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
End