title: DWM Thumbnail, change size of preview window
body: <p>I have window, which mirrors some another window with DWM thumbnails. Now I want when user resizes the preview window, than the preview area is resized to. How can I do this? How can I send update about new size of preview (change size 300x300 to size of preview window)?</p>
  
  <pre><code>switch (message) {
  case WM_CREATE:
      {
          HRESULT hr = S_OK;
          HTHUMBNAIL thumbnail = NULL;
          hr = DwmRegisterThumbnail(hWnd, ieWindowHwnd, &amp;thumbnail);
          if (SUCCEEDED(hr)) {
              // The destination rectangle size
              RECT dest = {0,0,300,300};
  
              // Set the thumbnail properties for use
              DWM_THUMBNAIL_PROPERTIES dskThumbProps;
              dskThumbProps.dwFlags = DWM_TNP_RECTDESTINATION | DWM_TNP_VISIBLE | DWM_TNP_SOURCECLIENTAREAONLY;
  
              // Use the window frame and client area
              dskThumbProps.fSourceClientAreaOnly = FALSE;
              dskThumbProps.fVisible = TRUE;
              dskThumbProps.rcDestination = dest;
  
              // Display the thumbnail
              hr = DwmUpdateThumbnailProperties(thumbnail, &amp;dskThumbProps);
          }
      }
      break;
  case WM_SIZE:
      {
          // What to do here.
      }
      break;
  </code></pre>