If the child window is set with borderless flag, no problem. If with system menu flag, then ResizeWindow() to move and center the child window is a requirement after SetParent API call. I was trying to avoid the extra step  
 
Code: Select all
If OpenWindow(0, 0, -1, 500, 600, "Parent Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget |#PB_Window_MaximizeGadget) And
   OpenWindow(1, WindowWidth(0)/2-200/2, WindowHeight(0)/2-200/2, 200, 200, "Child Window", #PB_Window_BorderLess)
  SetWindowColor(1, $DB887E)
  
  SetParent_(WindowID(1), WindowID(0))  
  
  
  If OpenWindow(2, 520, -1, 500, 600, "Parent Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget |#PB_Window_MaximizeGadget) And
     OpenWindow(3, 0, 0, 200, 200, "Child Window", #PB_Window_SystemMenu)  
    SetWindowColor(3, $DB887E)
    
    SetParent_(WindowID(3), WindowID(2))
    
    ResizeWindow(3, WindowWidth(2)/2-(WindowWidth(3, #PB_Window_FrameCoordinate)/2), WindowHeight(2)/2-(WindowHeight(3, #PB_Window_FrameCoordinate)/2), #PB_Ignore, #PB_Ignore) 
  EndIf
  
  Repeat : Event = WaitWindowEvent() : Until Event = #PB_Event_CloseWindow  
EndIf