title: Child window drawing issue in win32
body: <p>To  Start with , this is the desired look that I want to achieve but with rounded corners of the white region, and am not fully successful in doing so
  <img src="https://i.stack.imgur.com/w3IrJ.png" alt="desired look but with rounded  corner of white region"></p>
  
  <p>To achieve this , I have identified the screen co-ordinates of the rectangle which is to be made white and created a static text window and set a rounded region using this:</p>
  
  <pre><code>case WM_CREATE:
      SetRect( &amp;Rect,... );
                  hSubWnd = CreateWindow("STATIC",NULL,SS_LEFT|WS_CHILD|WS_VISIBLE,Rect.left,Rect.top,(Rect.right-Rect.left),(Rect.bottom-Rect.top),hFrame,(HMENU)NULL,NULL,NULL);
  
  
                  hrgn = CreateRoundRectRgn(Rect.left, Rect.top, Rect.right, Rect.bottom,15,15);
                  SetWindowRgn(hSubWnd,hrgn,TRUE);
  </code></pre>
  
  <p>Then to color the region sett above I used the following:</p>
  
  <pre><code>case WM_CTLCOLORSTATIC:
              //SetBkColor((HDC)wParam, RGB(0,0,0));
              if((HWND)lParam == hSubWnd)
              {
                  SetBkMode((HDC)wParam,TRANSPARENT);
  
                  return (INT_PTR )CreateSolidBrush(RGB(255,255,255));
              }
              break;
  </code></pre>
  
  <p>This makes the region colored white but the white region is not rounded as I expected.
  Here are my questions:</p>
  
  <p>1- How to make SetWindowRgn() work for child controls ?Is my approach correct or I need to take some other way to achieve my goal(rounding off the corners of the child)?</p>
  
  <p>2- The parent window has WS_CLIPCHILDREN style enabled , which means that whatever I do in WM_PAINT of the main windows is not going to paint the child window area. I need some text to be put in the white region of the child window as well. Where do I do that ? TextOut() doesnt seem to work inside WM_CTLCOLORSTATIC  handler.</p>
  
  <p>Should I change the window class of the child from "STATIC" to some custom class and write the WindowProc() for the child, wherein I handle the WM_PAINT  to draw text on it? </p>
  
  <p>Kindly provide your suggestions.</p>