title: DirectDraw question - running the application as a regular Windows application
body: <p>I am developing an application for video recording and I want to overlay the video preview with a logo and recording timer.</p>
  
  <p>I tried to run the full-screen application and everything worked fine. Then I tried to run the application as a regular Windows application and it returned an error.</p>
  
  <p>Could anyone take a look at the code below if there's a way to modify it to run the application as a regular Windows app?</p>
  
  <pre><code>HRESULT CViewfinderRenderer::OnStartStreaming()
  {
    HRESULT hr = S_OK;
    DDSURFACEDESC ddsd;
  
    m_pDD = NULL;
  
    //full screen settings
    hr = DirectDrawCreate(NULL, &amp;m_pDD, NULL);
    hr = m_pDD-&gt;SetCooperativeLevel(m_hWnd, DDSCL_FULLSCREEN);
  
    ddsd.dwSize = sizeof(ddsd); 
    ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; 
    ddsd.ddsCaps.dwCaps = DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE;
    ddsd.dwBackBufferCount = 1;
  
    //end full screen settings
  
    //normal settings
    /*hr = DirectDrawCreate(NULL, &amp;m_pDD, NULL);
    hr = m_pDD-&gt;SetCooperativeLevel(m_hWnd, DDSCL_NORMAL);
  
    ddsd.dwSize = sizeof(ddsd);
    ddsd.dwFlags = DDSD_BACKBUFFERCOUNT;
    ddsd.dwBackBufferCount = 1;*/
    //end normal settings
  
    hr = m_pDD-&gt;CreateSurface(&amp;ddsd, &amp;m_pSurface, NULL);
    if (hr != DD_OK) {
      return hr;
    }
  
    // Get backsurface
    hr = m_pSurface-&gt;EnumAttachedSurfaces(&amp;m_pBackSurface, EnumFunction);
  
    return S_OK;
  }
  </code></pre>