title: Change window background using SetClassLongPtr
body: <p>I have a drop-down menu that I want to use to change the background of my window; the window is defaulted at my "Winter background".</p>
  
  <pre><code>wClass.hbrBackground = CreatePatternBrush(LoadBitmap(hInst, MAKEINTRESOURCE(WinterBG)));
  </code></pre>
  
  <p>Whenever an item in the drop-down menu is chosen, it sets off CBN_SELCHANGE, where I grab the length and string of the item chosen. I want the background to change based on that.</p>
  
  <pre><code>case WM_COMMAND:
      {
          switch(HIWORD(wParam))
          {
          case CBN_SELCHANGE:
              {
                  ItemIndex = SendMessage((HWND)lParam, (UINT)CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
                  int ItemLen = SendMessage((HWND)lParam, (UINT)CB_GETLBTEXTLEN, (WPARAM)0, (LPARAM)0);
                  char* ListItem = (char*)malloc(ItemLen+1);
                  (char)SendMessageA((HWND)lParam, (UINT)CB_GETLBTEXT, (WPARAM)ItemIndex, (LPARAM)ListItem);
  
                  //////////////////////////////////////////////////////////////////////////////////////////////////
                  // I am certain this can be optimized
  
                  if ( ItemLen == 5 &amp;&amp; ListItem[0] == 'S' ) // Spring
                  {
                      MessageBox(NULL, L"Spring chosen", L"Confirmed", MB_ICONINFORMATION | MB_OK);
                      HBRUSH brush = CreatePatternBrush(LoadBitmap(wClass.hInstance, MAKEINTRESOURCE(SpringBG)));
                      SetClassLongPtr(hWnd, GCLP_HBRBACKGROUND, (LONG)brush);
                      InvalidateRect(hWnd, NULL, TRUE);
                      UpdateWindow(hWnd);
                  }
  .....
  </code></pre>
  
  <p>SetClassLongPtr isn't working how I want it to. After updating the window (I read InvalidateRect &amp; UpdateWindow achieve that), nothing changes--the background remains on my "WinterBG".</p>
  
  <p>Am I using SetClassLongPtr correctly? If not, how else can I change the background?</p>