Window Relationship Fundamentals

When you create a window, you can designate it as a child of another window. A window that has a child is referred to as a parent window. Windows CE has rules governing the display and behavior of parent and child windows. For example, a child window always appears in front of its parent window and can only draw inside its parent window.

Child windows can have their own child windows. A child window that can trace a relationship to a parent window through a chain of parent-child window relationships, however long, is said to be a descendent of the parent window. Likewise, a parent window that can trace a relationship to a child window through a chain of parent-child windows is said to be an ancestor window of that child window. For example, if Window A is the child window of one of Window B's child windows, Window A is a descendent of Window B, and Window B is an ancestor of Window A.

A window that has no parent is called a top-level window. Windows that have the same parent are referred to as sibling windows. Even though they may be in different applications, all top-level windows are considered siblings.

A window can be defined as another window's owner. Top-level windows may own other top-level windows. Unlike a window in the parent-child relationship, an owned window is allowed to draw outside of its owner's window.