Pinned Windows

The shell can request Quick View to display a new file in the same window as that used by the previous file viewer; that is, Quick View can "pin" a viewer window. Quick View communicates the shell's request by sending a WM_DROPFILES message to the file viewer. The message contains an internal drop files structure whose members include the path of the new file to be displayed. A file viewer uses the same code to handle both the "pinned" state and drag and drop operations in which the file viewer displays a file that the user has dragged and dropped on the file viewer's window.

Quick View implements the IFileViewerSite interface, which allows a file viewer to retrieve the handle of the current pinned window, if there is any, or set a new pinned window. When Quick View calls a file viewer's IFileViewer::ShowInitialize member function, the file viewer receives the address of Quick View's IFileViewerSite interface. If the file viewer saves the address of the interface, it should call the IFileViewerSite::AddRef member function to increment the reference count.

Only one pinned window can exist at a time. A file viewer uses the IFileViewerSite::SetPinnedWindow interface to set a new pinned window and the IFileViewerSite::GetPinnedWindow interface to retrieve the handle of the current pinned window.

When Quick View calls the file viewer's IFileViewer::Show member function, the file viewer receives the address of a FVSHOWINFO structure that includes a optional RECT structure. A valid RECT structure is a hint from the shell that the file viewer window should be pinned; the file viewer should set the size and position of its window based on the information in the structure.

If the file viewer window receives a WM_DROPFILES message, it should fill in the strNewFile member of the FVSHOWINFO structure with the path of the new file to be displayed, fill the rect member with the size and position of the viewer window, and set the appropriate values in the dwFlags member. The file viewer should also fill the punkrel member with the address of an interface that the new file viewer should call to release the previous file viewer. Doing this allows the previous file viewer to perform cleanup operations. The new file viewer may be the same as the current file viewer if the current one supports the new file. If the old file viewer is the same as the new one, the release does not do anything because the reference count is greater than zero.

If a file viewer returns a file but Quick View cannot find a viewer for the new file, it calls the IFileViewer::Show member function for the old file viewer with the FVSIF_NEWFAILED value. The file viewer can either terminate or continue showing the previous file.

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