IPreviewHandlerFrame::GetWindowContext method (shobjidl_core.h)

Gets a list of the keyboard shortcuts for the preview host.

Syntax

HRESULT GetWindowContext(
  [out] PREVIEWHANDLERFRAMEINFO *pinfo
);

Parameters

[out] pinfo

Type: PREVIEWHANDLERFRAMEINFO*

A pointer to a PREVIEWHANDLERFRAMEINFO structure that receives accelerator table information.

Return value

Type: HRESULT

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

Remarks

An accelerator table is a list of keyboard shortcuts and the commands that the host should execute. As an optimization, the preview handler can then look at the keystrokes it receives, check them against the accelerator table to see if the host is interested in them, and forward them on if appropriate, ignoring the commands in the structure. The accelerator table returned from IPreviewHandlerFrame::GetWindowContext, contains only keystrokes and does not contain valid command entries. Preview handlers can also skip this optimization and simply call IPreviewHandlerFrame::TranslateAccelerator for every keystroke. When the preview handler is destroyed, the accelerator table must be freed using the DestroyAcceleratorTable function.

This method should be called at the point when the preview handler has called SetSite and the results have been cached for later use by the preview handler. This method cannot be called by preview handlers running in low-integrity mode. Those preview handlers must always call IPreviewHandlerFrame::TranslateAccelerator for every keystroke.

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

See also

IPreviewHandlerFrame

IPreviewHandlerFrame::TranslateAccelerator