title: change the background color of static control text created using CreateWindow in vc++
body: <p>I am working on a open source project in <code>VC++</code> and want to change the backcolor of a static control..</p>
  
  <pre><code>hwndRenderMessage = CreateWindow(TEXT("STATIC"), Str("MainWindow.BeginMessage"),
      WS_CHILDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|SS_CENTER,
      0, 0, 0, 0, hwndRenderFrame, NULL, hinstMain, NULL);
  
  SendMessage(hwndRenderMessage, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), TRUE);
  </code></pre>
  
  <p>and the parent control of this control is</p>
  
  <pre><code> hwndRenderFrame = CreateWindow(OBS_RENDERFRAME_CLASS, NULL,
      WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN,
      0, 0, 0, 0,
      hwndMain, NULL, hinstMain, NULL);
  if(!hwndRenderFrame)
      CrashError(TEXT("Could not create render frame"));
  </code></pre>
  
  <p>So how to change the Background color of Static Control..</p>
  
  <p>I google it and getting tha same answer use</p>
  
  <pre><code>case WM_CTLCOLORSTATIC:
  {
  HDC hdcStatic = (HDC) wParam;
  SetTextColor(hdcStatic, RGB(0,0,0));
  SetBkColor(hdcStatic, RGB(230,230,230));
  return (INT_PTR)CreateSolidBrush(RGB(230,230,230));
  }
  </code></pre>
  
  <p>But there is no switch case in the file so what to do??
  Acctually i worked on c# but this is the first time on vc++</p>
  
  <p><img src="https://i.stack.imgur.com/Ltdf9.jpg" alt="Button image"></p>