title: how to make a child window top most (c++ win32 SDK)
body: <p>I'm trying to write a very simple gui layout designer, just like most popular IDE, something like:
  <img src="https://i.stack.imgur.com/SspgP.png" alt="enter image description here"></p>
  
  <p>How to implement those 8 dots around the widget?
  My idea is create a transparent static control(called ghost), with 8 dots around it, reisize it to the same size of the widget, cover the widget. The question is, how to make the ghost in front of other control?</p>
  
  <p>I write a small test, a <strong>button</strong> and an <strong>static</strong> control, I want the <strong>static</strong> always at top of z-order</p>
  
  <pre><code>#include &lt;windows.h&gt;
  
  LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  
  int main() {
      static char szAppName[] = "winhello";
      HWND        hwnd;
      MSG         msg;
      WNDCLASSEX  wndclass;
  
      wndclass.cbSize         = sizeof(wndclass);
      wndclass.style          = CS_HREDRAW | CS_VREDRAW;
      wndclass.lpfnWndProc    = WndProc;
      wndclass.cbClsExtra     = 0;
      wndclass.cbWndExtra     = 0;
      wndclass.hInstance      = GetModuleHandle(0);
      wndclass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
      wndclass.hIconSm        = LoadIcon(NULL, IDI_APPLICATION);
      wndclass.hCursor        = LoadCursor(NULL, IDC_ARROW);
      wndclass.hbrBackground  = (HBRUSH) GetStockObject(WHITE_BRUSH);
      wndclass.lpszClassName  = szAppName;
      wndclass.lpszMenuName   = NULL;
  
      RegisterClassEx(&amp;wndclass);
  
      hwnd = CreateWindow(szAppName, "Hello, world!",
              WS_OVERLAPPEDWINDOW,
              CW_USEDEFAULT, CW_USEDEFAULT,
              CW_USEDEFAULT, CW_USEDEFAULT,
              NULL, NULL, GetModuleHandle(0), NULL);
  
      ShowWindow(hwnd, SW_SHOW);
      UpdateWindow(hwnd);
  
      while ( GetMessage(&amp;msg, NULL, 0, 0) ) {
      TranslateMessage(&amp;msg);    /*  for certain keyboard messages  */
      DispatchMessage(&amp;msg);     /*  send message to WndProc        */
      } 
  
      return msg.wParam;
  }
  
  LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
      HWND hStatic;
      HWND hButton;
  
      switch ( iMsg ) {
      case WM_CREATE:
          {
  
              hButton = CreateWindow("button", "btn", WS_CHILD|WS_VISIBLE, 
                                   10, 10, 100, 100, hwnd, 0, 0, 0);
              hStatic = CreateWindow("static", "edt", WS_CHILD|WS_VISIBLE,
                                     40, 40, 50, 200, hwnd, 0, 0, 0);
              // WS_EX_TOPMOST doesn't work
              // HWND_TOP doesn't work
              // SetWindowPos(hStatic, HWND_TOP, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE);
          }
          break;
  
      case WM_DESTROY:
          PostQuitMessage(0);
          return 0;
      }
  
      return DefWindowProc(hwnd, iMsg, wParam, lParam);
  </code></pre>
  
  <p>run the program , click the button, the button goes to the front</p>
  
  <p><img src="https://i.stack.imgur.com/PCXWR.png" alt="enter image description here"></p>
  
  <p>I tried <strong>SetWindowPos(hStatic, HWND_TOP)</strong> and <strong>WS_EX_TOPMOST</strong>, didn't work. </p>