title: Child Window Z-Order
body: <p>I see in MSDN, it says:</p>
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx</a></p>
  <blockquote>
  <p>If the created window is a <strong>child window, its default position is at the bottom of the Z-order</strong>. If the created window is a top-level window, its default position is at the top of the Z-order (but beneath all topmost windows unless the created window is itself topmost).</p>
  </blockquote>
  <p>However, another documentation says:</p>
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632599(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/ms632599(v=vs.85).aspx</a></p>
  <blockquote>
  <p>When an application creates a window, the <strong>system puts it at the top of the z-order for windows of the same type</strong></p>
  </blockquote>
  <p>I tested it like this:</p>
  <pre><code>btn1 = ::CreateWindow(L&quot;button&quot;, L&quot;OK&quot;, WS_TABSTOP|BS_DEFPUSHBUTTON|WS_VISIBLE|WS_CHILD
                      , 10, 10, 50, 30, hWnd, (HMENU)51, hInst, NULL);
  btn2 = ::CreateWindow(L&quot;button&quot;, L&quot;Cancel&quot;, WS_TABSTOP|WS_CHILD|BS_PUSHBUTTON|WS_VISIBLE
                      , 20, 20, 70, 30, hWnd, (HMENU)52, hInst, NULL);
  </code></pre>
  <p>I created two buttons in a window and they overlapped, I can see that the button created later is covering the first button created.</p>
  <p>Is the first statement in MSDN contradictory to my testing?</p>