4

I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer.

I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the user chooses to view "big icons". Is there a way to retrieve that preview?

MyTImage := GiveMePreviewForFile('C:\Test\File.pdf');
UnDiUdin
  • 14,334
  • 37
  • 140
  • 233

2 Answers2

8

@user193655, using the IExtractImage interface is the way to go, this interface exposes methods that request a thumbnail image from a Shell folder

you can find a very complete sample in this site and the source code is here.

check this image

alt text

Glorfindel
  • 20,880
  • 13
  • 75
  • 99
RRUZ
  • 133,023
  • 16
  • 348
  • 476
  • 4
    At the moment, the source code can still be downloaded from archive.org: https://web.archive.org/web/20060115070800/http://www.delphi3000.com/article/3806/IExtractImageDemo.zip – Marcus Adams Dec 03 '13 at 13:53
2

Take a look at the docs for IExtractImage. Basically you use IShellFolder with IExtractImage to get the picture you are looking for.

Keith Giddings
  • 251
  • 1
  • 3