title: Why rounded corners when changing a Win32 window's parent?
body: <p>I'm trying to learn how to make a top-level Win32 window become a child of another window.</p>
  
  <p>When I change a window's parent, I still get ugly rounded corners, as though it was a top-level window with a rounded title bar. Why? And how do I fix this? (I couldn't get <code>WM_UPDATEUISTATE</code> to help, but I'm not sure how to use it correctly either.)</p>
  
  <p><img src="https://i.stack.imgur.com/duo4p.png" alt="Screenshot"></p>
  
  <pre><code>#include &lt;tchar.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;commctrl.h&gt;
  int _tmain()
  {
      WNDCLASS wndClass = {
          0, &amp;DefWindowProc, 0, 0, NULL, NULL, LoadCursor(NULL, IDC_ARROW),
          GetSysColorBrush(COLOR_3DFACE), NULL, TEXT("MyWindowClass")
      };
      ATOM atom = RegisterClass(&amp;wndClass);
      HWND hWnd = CreateWindow(MAKEINTATOM(atom), TEXT("Win"),
          WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT,
          CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
      HWND hWndChild = CreateWindowEx(WS_EX_CLIENTEDGE,
          WC_EDIT, TEXT("Control"), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
          10, 10, 86, 24, NULL, NULL, NULL, NULL);
      SetParent(hWndChild, hWnd);                     // Change the parent
      SetWindowLong(hWndChild, GWL_STYLE,             // Set child styles
          GetWindowLong(hWndChild, GWL_STYLE)
              &amp; ~(WS_OVERLAPPED | WS_POPUP | WS_CAPTION | WS_SYSMENU |
                  WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
              | WS_CHILDWINDOW);
      SetWindowPos(hWndChild, NULL, 0, 0, 0, 0,       // Refresh
          SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE
              | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_FRAMECHANGED);
      BOOL bRet;
      MSG msg;
      while ((bRet = GetMessage(&amp;msg, hWnd, 0, 0)) != 0 &amp;&amp; bRet != -1)
      {
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  }
  </code></pre>