CAtlPreviewCtrlImpl Class

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see CAtlPreviewCtrlImpl Class on docs.microsoft.com. This class is an ATL implementation of a window that is placed on a host window provided by the Shell for Rich Preview.

System_CAPS_ICON_important.jpg Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CAtlPreviewCtrlImpl : public CWindowImpl<CAtlPreviewCtrlImpl>, public IPreviewCtrl;

Public Constructors

NameDescription
CAtlPreviewCtrlImpl::~CAtlPreviewCtrlImplDestructs a preview control object.
CAtlPreviewCtrlImpl::CAtlPreviewCtrlImplConstructs a preview control object.

Public Methods

NameDescription
CAtlPreviewCtrlImpl::CreateCalled by a Rich Preview handler to create the Windows window.
CAtlPreviewCtrlImpl::DestroyCalled by a Rich Preview handler when it needs to destroy this control.
CAtlPreviewCtrlImpl::FocusSets input focus to this control.
CAtlPreviewCtrlImpl::OnPaintHandles the WM_PAINT message.
CAtlPreviewCtrlImpl::RedrawTells this control to redraw.
CAtlPreviewCtrlImpl::SetHostSets a new parent for this control.
CAtlPreviewCtrlImpl::SetPreviewVisualsCalled by a Rich Preview handler when it needs to set visuals of rich preview content.
CAtlPreviewCtrlImpl::SetRectSets a new bounding rectangle for this control.

Protected Methods

NameDescription
CAtlPreviewCtrlImpl::DoPaintCalled by the framework to render the preview.

Protected Constants

NameDescription
CAtlPreviewCtrlImpl::m_plfFont used to display text in the preview window.

Protected Data Members

NameDescription
CAtlPreviewCtrlImpl::m_clrBackBackground color of the preview window.
CAtlPreviewCtrlImpl::m_clrTextText color of preview window.

TBase

ATL::CMessageMap

ATL::CWindowImplRoot<TBase>

ATL::CWindowImplBaseT<TBase,TWinTraits>

ATL::CWindowImpl<CAtlPreviewCtrlImpl>

IPreviewCtrl

ATL::CAtlPreviewCtrlImpl

Header: atlpreviewctrlimpl.h

Constructs a preview control object.

CAtlPreviewCtrlImpl(void) : m_clrText(0),
   m_clrBack(RGB(255, 255, 255)), m_plf(NULL);

Remarks

Destructs a preview control object.

virtual ~CAtlPreviewCtrlImpl(void);

Remarks

Called by a Rich Preview handler to create the Windows window.

virtual BOOL Create(HWND hWndParent, const RECT* prc);

Parameters

hWndParent
A handle to the host window supplied by the Shell for Rich Preview.

prc
Specifies the initial size and position of the window.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

Called by a Rich Preview handler when it needs to destroy this control.

virtual void Destroy();

Remarks

Called by the framework to render the preview.

virtual void DoPaint(HDC hdc);

Parameters

hdc
A handle to a device context for painting.

Remarks

Sets input focus to this control.

virtual void Focus();

Remarks

Background color of the preview window.

COLORREF m_clrBack;

Remarks

Text color of the preview window.

COLORREF m_clrText;

Remarks

Font used to display text in the preview window.

const LOGFONTW* m_plf;

Remarks

Handles the WM_PAINT message.

LRESULT OnPaint(  
    UINT nMsg,
    WPARAM wParam,
    LPARAM lParam,
    BOOL& bHandled);

Parameters

nMsg
Set to WM_PAINT.

wParam
This parameter is not used.

lParam
This parameter is not used.

bHandled
When this function returns, it contains TRUE.

Return Value

Always returns 0.

Remarks

Tells this control to redraw.

virtual void Redraw();

Remarks

Sets a new parent for this control.

virtual void SetHost(HWND hWndParent);

Parameters

hWndParent
A handle to the new parent window.

Remarks

Called by a Rich Preview handler when it needs to set visuals of rich preview content.

virtual void SetPreviewVisuals(
    COLORREF clrBack,
    COLORREF clrText,
    const LOGFONTW* plf);

Parameters

clrBack
Background color of the preview window.

clrText
Text color of the preview window.

plf
Font used to display text in the preview window.

Remarks

Sets a new bounding rectangle for this control.

virtual void SetRect(const RECT* prc, BOOL bRedraw);

Parameters

prc
Specifies the new size and position of the preview control.

bRedraw
Specifies whether the control should be redrawn.

Remarks

ATL COM Desktop Components

Show: