IFileViewer
The shell uses the
IFileViewer interface to tell a file viewer object when to show its user interface for
the file being viewed or to print the file. In addition to the usual
IUnknown members, the interface includes the
ShowInitialize,
Show, and
PrintTo member functions.
Before calling the
Show member function, the shell calls
ShowInitialize to instruct the file viewer to perform any creations, allocations, or
loading.
ShowInitialize may fail, whereas
Show may not because Quick View needs to know, before anything becomes visible and
before transferring control to the file viewer, whether the file viewer can
show the file. If the file viewer can show the file, Quick View hides its
Searching dialog box before the file viewer window appears.
The
ShowInitialize member function should return the same FV_ error codes listed in the topic
Structure of Registry Entries. Although the sample file viewer included in the Win32 SDK uses a more
generic form of error codes, new file viewer DLLs should use the FV_ form.
The
Show member function is similar to the Windows
ShowWindow function in that it receives a Show command indicating how the file viewer
should initially display its window. The meaning of the Show command is exactly
the same as for
ShowWindow. In general, Quick View passes the Show command from its
WinMain function directly to
IFileViewer::Show,
which passes the command to
ShowWindow. Since Quick View obtains this parameter from the shell, this design enables
the shell to open a file viewer in the minimized, normal, or maximized state and
even allows the shell to hide a file viewer (with the SW_HIDE value). There is
no extra overhead in providing this flexibility. Note that the Windows 95
shell always starts Quick View with the SW_SHOWNORMAL value.
The only case when
Show may fail is if
ShowInitialize has not been called. In that case, it returns the E_UNEXPECTED status code
(SCODE). Otherwise,
Show must return the NOERROR error code.
The
PrintTo member function is like
Show in that it does not return until it finishes printing or an error occurs. If
an error occurs, the file viewer object is responsible for informing the user
of the problem. When calling
PrintTo, the shell specifies the name of the printer driver that the file viewer
should use to print the file. The shell also specifies a flag that indicates
whether the file viewer should display any UI elements, including error message,
during the print operation. If the flag is FALSE, the file viewer may show Print
dialog boxes, Printer Setup dialog boxes, error messages, and so on.
The interface identifier of
IFileViewer is defined in the Windows header files as the IID_IFileViewer interface
identifier.
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers
- More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
- Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database