title: C++ Win32 Radio button background color
body: <p>So first i'm using the windows API, no special libraries.</p>
  
  <p>I've created a radio button with this code:</p>
  
  <pre><code>g_hRadioButton = CreateWindowEx(0, "BUTTON", "Radio Button",
      WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON,
      10, 55, 120, 25, hWnd, (HMENU)RADIOBUTTON, GetModuleHandle(NULL), NULL);
  </code></pre>
  
  <p>Now I have a black background for the main window, so I would like the text to be white, and the background to be transparent.</p>
  
  <p>I've tried checking both the <code>WM_CTLCOLORBTN</code> and <code>WM_CTLCOLORSTATIC</code> messages.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>case WM_CTLCOLORBTN:
      SetTextColor((HDC)wParam, 0xffffff);
      SetBkMode((HDC)wParam, TRANSPARENT);
      return (LRESULT)GetStockObject(BLACK_BRUSH);
  
  case WM_CTLCOLORSTATIC:
      SetTextColor((HDC)wParam, 0xffffff);
      SetBkMode((HDC)wParam, TRANSPARENT);
      return (LRESULT)GetStockObject(NULL_BRUSH);
  </code></pre>
  
  <p>This doesn't work, the backgrounds still white and the text is black.</p>
  
  <p>Also i've enabled visual styles by linking to ComCtl32.lib, creating the manifest and all that.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Trying to process the <code>NM_CUSTOMDRAW</code> message now instead.
  Here's my code but it's having no effect, and i'm pretty sure im doing something wrong.</p>
  
  <pre><code>case WM_NOTIFY:
  {
      if (((LPNMHDR)lParam)-&gt;code == NM_CUSTOMDRAW)
      {
          LPNMCUSTOMDRAW nmCD = (LPNMCUSTOMDRAW)lParam;
          switch(nmCD-&gt;dwDrawStage)
          {
              case CDDS_PREPAINT:
                  return CDRF_NOTIFYITEMDRAW;
  
              case CDDS_ITEMPREPAINT:
                  SetTextColor(nmCD-&gt;hdc, 0xffffff);
                  SetBkColor(nmCD-&gt;hdc, 0x000000);
                  return CDRF_DODEFAULT;
          }
      }
  
      break;
  }
  </code></pre>
  
  <p>Could someone at least point me in the right direction?</p>