title: Capture the screen shot of another application's screen Delphi
body: <p>I have searched StackOverlow and googled myself silly, but can't find a solution to this problem.</p>
  
  <p>What I wish to do is be able to preview the contents of a file.  I can do this at present for a BMP, JPEG etc. but I'd like to be able to do it for any file that has a default program association. The most likely example is a PDF file, but any file is theoretically possible in this application.</p>
  
  <p>What I had in mind was to:-</p>
  
  <ol>
  <li>Open the file (with ShellExecuteEx?)</li>
  <li>Wait for the open to complete</li>
  <li>Copy the contents of the first window displayed by the opening program</li>
  <li>Save the window to a TBitMap</li>
  <li>Close the file/program/window</li>
  <li>Display the captured BMP in a TImage as my preview.</li>
  </ol>
  
  <p>I reckon that I can do steps 1 and 6, but the bits in the middle have me beaten :-(</p>
  
  <p>I'm working with Delphi-7</p>
  
  <p>Cheers</p>
  
  <p>Jeff</p>