IPreviewHandler (shlwapi)
Last changed: -206.116.16.22

.
Summary
This interface describes the API implemented by preview handlers. When a handler for a given file type is installed on a system, the shell or custom apps can use it to display the contents of these files in their window. Preview handlers usually do not allow in-place editing and may not display all the information contained in the file (for example, macros inside Office documents are ignored by their preview handlers)

C# Signature:

[System.Runtime.InteropServices.ComImport]

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]

[Guid("8895b1c6-b41f-4c1c-a562-0d564250836f")]

public interface IPreviewHandler

{

    void SetWindow(IntPtr hwnd, ref RECT rect);
    void SetRect(ref RECT rect);
    void DoPreview();
    void Unload();

    void SetFocus();
    void QueryFocus(out IntPtr phwnd);

    [PreserveSig]
    uint TranslateAccelerator(ref MSG pmsg);

}

VB Signature:

TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

You can use this interface to leverage previewers already installed on a system to display a document preview in a Windows Forms app.

Sample Code:

Please add some!

Documentation