From 3f95d417d9e623ac0c74df8ef11d7a01846392dd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Sep 2003 19:07:23 +0000 Subject: Initial Import --- Common/PropPageHolder.h | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Common/PropPageHolder.h (limited to 'Common/PropPageHolder.h') diff --git a/Common/PropPageHolder.h b/Common/PropPageHolder.h new file mode 100644 index 0000000..4fec7ee --- /dev/null +++ b/Common/PropPageHolder.h @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////////////////// +// +// PropPageHolder.h : header file +// +// CPropPageHolder manages the components IPropertyPage Interface +// +// It also exposes a IPropertyPageSite Interface for the +// Component (not used for much though) +// +////////////////////////////////////////////////////////////////// + +#if !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_) +#define AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +///////////////////////////////////////////////////////////////////////////// +// CPropPageHolder command target + +class ATL_NO_VTABLE CPropPageHolder : + public CComObjectRootEx, + public IPropertyPageSite +{ + +// Attributes +public: + CPropPageHolder(); +// CPropPageHolder(IPropertyPage* pPage, IUnknown* pSite); + virtual ~CPropPageHolder(); + +// Operations +public: + HRESULT Close(); + + bool IsActivated(); // Is Proppage Created? + HRESULT Apply(); // Save Changes to Data Object + bool IsInitialized(); // Is Initialized? + + // Checks to see if it has a IPropPage + HRESULT Initialize(IPropertyPage* pUnk, IUnknown* pSite); + + // Activates and Shows the Page + // For best results start with WS_VISIBLE = false in + // dialog template (no flicker) + HRESULT Create(HWND hwndParent, const RECT& rect, bool bModalParent = true); + + // DeActivates Page and Releases IPropPage + HRESULT Destroy(); + + // Window Functions + HRESULT Show(UINT nCmdShow); + HRESULT Move(const RECT& rect); + +// Implementation +protected: + HRESULT LoadInfo(); + + // Is Created or not? + bool m_bActivated; + + IPropertyPage* m_pPropPage; + PROPPAGEINFO m_PageInfo; + IUnknown* m_pSite; // This is a pointer to the Page Container Site + // Returned from IPropertyPageSite::GetPageContainer + +public: + DWORD GetHelpContext(); + string GetHelpFile(); + string GetTitle(); + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CPropPageHolder) + COM_INTERFACE_ENTRY(IPropertyPageSite) +END_COM_MAP() + + // IPropertyBag + STDMETHOD(OnStatusChange)(DWORD dwFlags); + STDMETHOD(GetLocaleID)(LCID* pLocaleID); + STDMETHOD(GetPageContainer)(IUnknown** ppUnk); + STDMETHOD(TranslateAccelerator)(LPMSG pMsg); + +}; + +///////////////////////////////////////////////////////////////////////////// + +#endif // !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_) -- cgit v1.2.3