IPreviewHandler::SetWindow method (shobjidl_core.h)

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(
  [in] HWND       hwnd,
  [in] const RECT *prc
);

Parameters

[in] hwnd

Type: HWND

A handle to the parent window.

[in] 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

Requirement Value
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