Attach a Window child to Window Parent?

Success!!

Ok this took a few declares to attach a child window to a parent window (Move the parent and the child follows seamlessly). Here is the sample project I built.

https://www.dropbox.com/s/ue5ayl9o5r7cfh6/ChildParentMoveTest.xojo_binary_project?dl=1

The View code is in ChildWindow.Open and the controller code is in the WindowsAPI module.

// SET PARENT OF THIS WINDOW TO MAIN WINDOW
Var setParentResultInt as Integer = WindowsAPI.setParent(Self.Handle, ParentWindow.Handle)

// SET CHILD BIT ON WINDOW STYLE
Var childStyle as Integer = WS_CHILDWINDOW
Var setWinStyleResultInt as Integer = WindowsAPI.SetWindowLong(Self.Handle, GWL_STYLE, childStyle)

// SET BORDER AROUND CHILD WINDOW
Var borderStyle as Integer = WS_BORDER
Var borderResultInt as Integer = WindowsAPI.SetWindowLong(Self.Handle, GWL_STYLE, borderStyle)

// SET CHILD X/Y POS  VARIABLES
Var newXpos as Integer = (ParentWindow.Width/2 - self.Width/2)
Var newYpos as Integer = (ParentWindow.Height/2 - self.Height/2)
Var newW as Integer = Self.Width
Var newH as Integer = Self.Height
Var moveWinResultInt as Integer = WindowsAPI.MoveWindow(Self.Handle, newXpos, newYpos, newW, newH, True)

// UPDATE PARENT
Var updateWinResultInt as Integer = WindowsAPI.UpdateWindow(ParentWindow.Handle)