title: paint background in mfc
body: <p>I am experimenting with painting the background of a window in c++ using the MFC library. It is mandated that i use this framework because I am working on an MFC application. I have tried several different methods but cannot get it to work. So i recently opened a blank project and just want to figure out how to paint the background but it is not working. Any help would be great. Here is my code...</p>
  
  <pre><code>class CExerciseApp : public CWinApp
  {   
       //a pointer to our window class object
       Basic_Window *bwnd; 
  
       BOOL InitInstance()
       {  
           bwnd = new Basic_Window();
           m_pMainWnd = bwnd;
           bwnd-&gt;ShowWindow(1);
  
           HWND hWnd = GetActiveWindow();
  
           CRect drawing_area;
           GetClientRect(hWnd, &amp;drawing_area);
  
           CBrush newBrush;
           newBrush.CreateSolidBrush(RGB(255,255,255));
  
           CDC* dc = bwnd-&gt;GetDC();
           dc-&gt;FillRect(&amp;drawing_area, &amp;newBrush);
           bwnd-&gt;RedrawWindow();
           return TRUE;
      }    
  };  
  </code></pre>