How to retrieve the file previews used by windows

2019-01-23 09:27发布

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');

2条回答
啃猪蹄的小仙女
2楼-- · 2019-01-23 10:05

@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 http://i46.tinypic.com/2updzbd.png

查看更多
家丑人穷心不美
3楼-- · 2019-01-23 10:20

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

查看更多
登录 后发表回答