Windows file preview - similar to the preview panel in Explorer

In Windows 7 (and I think Vista) Explorer has a preview panel that allows you to view content for some types of files (MS Office, images, etc.). Is any API accessing this feature?

I used WindowsAPICodePack , which has a ShellFile.Thumbnail shell, but it only seems to display a thumbnail icon for file types that Explorer can view. For example, for a Word file, it displays only the MS Word icon, where Explorer can actually view the contents of the file. It works as if I want for image types, but not for other file types.

+3
source share
4 answers
+4
source

An example code (although it is difficult to read ... you need to select the text) is here: Promotion of vista / office 2007 visitors in the winform application

+2
source

.Net IPreviewHandler .

0

[HKEY_CLASSES_ROOT\.ext]
"PerceivedType"="text"

Microsoft IPreviewHandler [MSDN], COM- . ++ [MSDN].

The object will be initialized via IInitializeWithFile [MSDN] or IInitializeWithStream [MSDN]

After you have implemented it, you need to register it on your [MSDN] system for different types of files, for example:

HKEY_CLASSES_ROOT
   xyzfile
      shellex
         {8895b1c6-b41f-4c1c-a562-0d564250836f}
            (Default) = [REG_SZ] {<Class-ID-of-your-COM-object>}
0
source

Source: https://habr.com/ru/post/1796190/


All Articles