CMFCPreviewCtrlImpl Class

This class implements a window that is placed on a host window provided by the Shell for Rich Preview.

Syntax

class CMFCPreviewCtrlImpl : public CWnd;

Members

Public Constructors

Name Description
CMFCPreviewCtrlImpl::~CMFCPreviewCtrlImpl Destructs a preview control object.
CMFCPreviewCtrlImpl::CMFCPreviewCtrlImpl Constructs a preview control object.

Public Methods

Name Description
CMFCPreviewCtrlImpl::Create Overloaded. Called by a Rich Preview handler to create the Windows window.
CMFCPreviewCtrlImpl::Destroy Called by a Rich Preview handler when it needs to destroy this control.
CMFCPreviewCtrlImpl::Focus Sets input focus to this control.
CMFCPreviewCtrlImpl::GetDocument Returns a document connected to this preview control.
CMFCPreviewCtrlImpl::Redraw Tells this control to redraw.
CMFCPreviewCtrlImpl::SetDocument Called by the preview handler to create a relationship between the document implementation and the preview control.
CMFCPreviewCtrlImpl::SetHost Sets a new parent for this control.
CMFCPreviewCtrlImpl::SetPreviewVisuals Called by a Rich Preview handler when it needs to set visuals of rich preview content.
CMFCPreviewCtrlImpl::SetRect Sets a new bounding rectangle for this control.

Protected Methods

Name Description
CMFCPreviewCtrlImpl::DoPaint Called by the framework to render the preview.

Protected Data Members

Name Description
CMFCPreviewCtrlImpl::m_clrBackColor Background color of preview window.
CMFCPreviewCtrlImpl::m_clrTextColor Text color of preview window.
CMFCPreviewCtrlImpl::m_font Font used to display text in the preview window.
CMFCPreviewCtrlImpl::m_pDocument A pointer to a document whose content is previewed in the control.

Requirements

Header: afxwin.h

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CMFCPreviewCtrlImpl

CMFCPreviewCtrlImpl::CMFCPreviewCtrlImpl

Constructs a preview control object.

Syntax

CMFCPreviewCtrlImpl();

CMFCPreviewCtrlImpl::Create

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

Syntax

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

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.

pContext
A pointer to a creation context.

Return Value

TRUE if creation succeeded; otherwise FALSE.

CMFCPreviewCtrlImpl::Destroy

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

Syntax

virtual void Destroy();

CMFCPreviewCtrlImpl::DoPaint

Called by the framework to render the preview.

Syntax

virtual void DoPaint(
   CPaintDC* pDC
);

Parameters

pDC
A pointer to a device context for painting.

CMFCPreviewCtrlImpl::Focus

Sets input focus to this control.

Syntax

virtual void Focus();

CMFCPreviewCtrlImpl::GetDocument

Returns a document connected to this preview control.

Syntax

ATL::IDocument* GetDocument();

Return Value

A pointer to a document, whose content is previewed in the control.

CMFCPreviewCtrlImpl::m_clrBackColor

Background color of the preview window.

Syntax

COLORREF m_clrBackColor;

CMFCPreviewCtrlImpl::m_clrTextColor

Text color of the preview window.

Syntax

COLORREF m_clrTextColor;

CMFCPreviewCtrlImpl::m_font Font used to display text in the preview window.

Syntax

CFont m_font;

CMFCPreviewCtrlImpl::m_pDocument

A pointer to a document whose content is previewed in the control.

Syntax

ATL::IDocument* m_pDocument;

CMFCPreviewCtrlImpl::Redraw

Tells this control to redraw.

Syntax

virtual void Redraw();

CMFCPreviewCtrlImpl::SetDocument

Called by the preview handler to create a relationship between the document implementation and the preview control.

Syntax

void SetDocument(
   IDocument* pDocument
);

Parameters

pDocument
A pointer to the document implementation.

CMFCPreviewCtrlImpl::SetHost

Sets a new parent for this control.

Syntax

virtual void SetHost(
   HWND hWndParent
);

Parameters

hWndParent
A handle to the new parent window.

CMFCPreviewCtrlImpl::SetPreviewVisuals

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

Syntax

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

Parameters

clrBack
Background color of preview window.

clrText
Text color of preview window.

plf
Font used to display text in the preview window.

CMFCPreviewCtrlImpl::SetRect

Sets a new bounding rectangle for this control.

Syntax

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

Usually a new bounding rectangle is set when the host control is resized.

CMFCPreviewCtrlImpl::~CMFCPreviewCtrlImpl

Destructs a preview control object.

Syntax

virtual ~CMFCPreviewCtrlImpl();