title: Why could DwmRegisterThumbnail fail?
body: <p>I am trying to capture screen of a child window and render it on parent surface in Windows 7.</p>
  
  <pre><code>HTHUMBNAIL thumbnail = NULL;
  HRESULT hr = S_OK;
  hr = DwmRegisterThumbnail( hWnd, visualHwnd, &amp;thumbnail );
  
  if( SUCCEEDED( hr ) )
  {
      ...
  }
  </code></pre>
  
  <p>This fails all the time. visualHwnd is the child window and hWnd is the parent. I also tried it without the parent-child relationship and it just doesn't draw anything, well expected because if statement fails.</p>
  
  <p>What could be the reason?</p>
  
  <p>Here is how I create the parent:</p>
  
  <pre><code>hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
  </code></pre>
  
  <p>And the child:</p>
  
  <pre><code>CreateProcessA( NULL, "PVFOX.exe \"view3.pv\" ", NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &amp;si, &amp;piVisual);
  WaitForInputIdle( piVisual.hProcess, INFINITE );
  Sleep( 3000 );
  
  EnumWindows(EnumWindowsProc, 0);
  SetParent(visualHwnd, hWnd);
  </code></pre>