Skip to content

Latest commit

 

History

History
300 lines (225 loc) · 7.86 KB

File metadata and controls

300 lines (225 loc) · 7.86 KB
title CMFCPreviewCtrlImpl Class | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
f1_keywords
CMFCPreviewCtrlImpl
AFXWIN/CMFCPreviewCtrlImpl
AFXWIN/CMFCPreviewCtrlImpl::CMFCPreviewCtrlImpl
AFXWIN/CMFCPreviewCtrlImpl::Create
AFXWIN/CMFCPreviewCtrlImpl::Destroy
AFXWIN/CMFCPreviewCtrlImpl::Focus
AFXWIN/CMFCPreviewCtrlImpl::GetDocument
AFXWIN/CMFCPreviewCtrlImpl::Redraw
AFXWIN/CMFCPreviewCtrlImpl::SetDocument
AFXWIN/CMFCPreviewCtrlImpl::SetHost
AFXWIN/CMFCPreviewCtrlImpl::SetPreviewVisuals
AFXWIN/CMFCPreviewCtrlImpl::SetRect
AFXWIN/CMFCPreviewCtrlImpl::DoPaint
AFXWIN/CMFCPreviewCtrlImpl::m_clrBackColor
AFXWIN/CMFCPreviewCtrlImpl::m_clrTextColor
AFXWIN/CMFCPreviewCtrlImpl::m_font
AFXWIN/CMFCPreviewCtrlImpl::m_pDocument
dev_langs
C++
helpviewer_keywords
CMFCPreviewCtrlImpl class
ms.assetid 06257fa0-54c9-478d-9d68-c9698c3f93ed
caps.latest.revision 28
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

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();