I have searched StackOverlow and googled myself silly, but can't find a solution to this problem.
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.
What I had in mind was to:-
- Open the file (with ShellExecuteEx?)
- Wait for the open to complete
- Copy the contents of the first window displayed by the opening program
- Save the window to a TBitMap
- Close the file/program/window
- Display the captured BMP in a TImage as my preview.
I reckon that I can do steps 1 and 6, but the bits in the middle have me beaten :-(
I'm working with Delphi-7
Cheers
Jeff