title: Using d3d9's backbuffer functionalities correctly
body: <p>I'm trying to write a simple DLL which allow me to take a screenshot of the program calling it.</p>
  
  <p>The program give me its Window Handle using the DLL call.</p>
  
  <p>The CreateDevice functions, CreateOffScreenPlainSurface, works fine using the provided handle, according to HRESULT values returned.</p>
  
  <p>But the output image is blank, then I think that I'm not using the DirectX's GetBackBuffer functions correctly.</p>
  
  <p>Here is how I proceed:</p>
  
  <pre><code>HRESULT GFBD_r = g_pd3dDevice-&gt;GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &amp;pSurface);
  HRESULT LR_r = pSurface-&gt;LockRect(&amp;lr, &amp;rect, D3DLOCK_READONLY);
  memcpy(&amp;Frame[0], lr.pBits, Width*Height*4);
  pSurface-&gt;UnlockRect();
  </code></pre>
  
  <p>My Frame vector is still remaining empty. Maybe the problem came from Multisampling ? I don't exactly understand how does it works, except that i'm using d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; in my    D3DPRESENT_PARAMETERS    .</p>