IPreviewHandler::SetWindow method

Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window.

Syntax

HRESULT SetWindow(
  HWND       hwnd,
  const RECT *prc
);

Parameters

hwnd

Type: HWND

A handle to the parent window.

prc

Type: const RECT*

A pointer to a RECT defining the area for the previewer.

Return Value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The preview handler is responsible for painting the entire area defined by prc. If the previewer window has been created, the preview handler must associate the previewer window to the new parent hwnd and resize the previewer window to the area defined by prc. If the previewer window has not yet been created, the preview handler must remember this information for when the previewer window is created in IPreviewHandler::DoPreview.

Note  It is preferred that this information be stored prior to calling IPreviewHandler::DoPreview. Doing so increases performance at setup time for any cases where the preview does not start.
 

Requirements

   
Minimum supported client Windows Vista, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
Redistributable Windows Search 4 or later