Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.7 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. rstrprog.h
  5. Abstract:
  6. This file contains the declaration of the CRstrProgress class, which
  7. wraps Progress control from the Common Control.
  8. Revision History:
  9. Seong Kook Khang (SKKhang) 10/08/99
  10. created
  11. ******************************************************************************/
  12. #ifndef _RSTRPROG_H__INCLUDED_
  13. #define _RSTRPROG_H__INCLUDED_
  14. #pragma once
  15. //#include "resource.h" // main symbols
  16. //#include <atlctl.h>
  17. #define IDC_PROGRESS 100
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CRstrProgress
  20. class ATL_NO_VTABLE CRstrProgress :
  21. public CComObjectRootEx<CComSingleThreadModel>,
  22. public CStockPropImpl<CRstrProgress, IRstrProgress, &IID_IRstrProgress, &LIBID_RestoreUILib>,
  23. public CComControl<CRstrProgress>,
  24. public IPersistStreamInitImpl<CRstrProgress>,
  25. public IOleControlImpl<CRstrProgress>,
  26. public IOleObjectImpl<CRstrProgress>,
  27. public IOleInPlaceActiveObjectImpl<CRstrProgress>,
  28. public IViewObjectExImpl<CRstrProgress>,
  29. public IOleInPlaceObjectWindowlessImpl<CRstrProgress>,
  30. public IPersistStorageImpl<CRstrProgress>,
  31. public ISpecifyPropertyPagesImpl<CRstrProgress>,
  32. public IQuickActivateImpl<CRstrProgress>,
  33. public IDataObjectImpl<CRstrProgress>,
  34. public IProvideClassInfo2Impl<&CLSID_RstrProgress, NULL, &LIBID_RestoreUILib>,
  35. public IConnectionPointContainerImpl<CRstrProgress>,
  36. public IConnectionPointImpl<CRstrProgress, &DIID_DRstrProgressEvents>,
  37. public CComCoClass<CRstrProgress, &CLSID_RstrProgress>
  38. {
  39. public:
  40. CContainedWindow m_cCtrl;
  41. CRstrProgress() : m_cCtrl(PROGRESS_CLASS, this, 1)
  42. {
  43. m_bWindowOnly = TRUE;
  44. }
  45. DECLARE_REGISTRY_RESOURCEID(IDR_RSTRPROGRESS)
  46. DECLARE_PROTECT_FINAL_CONSTRUCT()
  47. BEGIN_COM_MAP(CRstrProgress)
  48. COM_INTERFACE_ENTRY(IRstrProgress)
  49. COM_INTERFACE_ENTRY(IDispatch)
  50. COM_INTERFACE_ENTRY(IViewObjectEx)
  51. COM_INTERFACE_ENTRY(IViewObject2)
  52. COM_INTERFACE_ENTRY(IViewObject)
  53. COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
  54. COM_INTERFACE_ENTRY(IOleInPlaceObject)
  55. COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
  56. COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
  57. COM_INTERFACE_ENTRY(IOleControl)
  58. COM_INTERFACE_ENTRY(IOleObject)
  59. COM_INTERFACE_ENTRY(IPersistStreamInit)
  60. COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
  61. COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
  62. COM_INTERFACE_ENTRY(IQuickActivate)
  63. COM_INTERFACE_ENTRY(IPersistStorage)
  64. COM_INTERFACE_ENTRY(IDataObject)
  65. COM_INTERFACE_ENTRY(IProvideClassInfo)
  66. COM_INTERFACE_ENTRY(IProvideClassInfo2)
  67. COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  68. END_COM_MAP()
  69. BEGIN_PROP_MAP(CRstrProgress)
  70. PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
  71. PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
  72. PROP_ENTRY("BackColor", DISPID_BACKCOLOR, CLSID_StockColorPage)
  73. PROP_ENTRY("ForeColor", DISPID_FORECOLOR, CLSID_StockColorPage)
  74. // Example entries
  75. // PROP_ENTRY("Property Description", dispid, clsid)
  76. // PROP_PAGE(CLSID_StockColorPage)
  77. END_PROP_MAP()
  78. BEGIN_CONNECTION_POINT_MAP(CRstrProgress)
  79. CONNECTION_POINT_ENTRY(DIID_DRstrProgressEvents)
  80. END_CONNECTION_POINT_MAP()
  81. BEGIN_MSG_MAP(CRstrProgress)
  82. MESSAGE_HANDLER(WM_CREATE, OnCreate)
  83. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  84. CHAIN_MSG_MAP(CComControl<CRstrProgress>)
  85. ALT_MSG_MAP(1)
  86. // Replace this with message map entries for superclassed SysMonthCal32
  87. END_MSG_MAP()
  88. // Handler prototypes:
  89. // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  90. // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  91. // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  92. LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  93. LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  94. // IOleInPlaceObject
  95. STDMETHOD(SetObjectRects)(LPCRECT prcPos,LPCRECT prcClip);
  96. // IViewObjectEx
  97. DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE)
  98. // IRstrProgress
  99. public:
  100. OLE_COLOR m_clrBackColor;
  101. OLE_COLOR m_clrForeColor;
  102. public:
  103. STDMETHOD(get_hWnd)( OLE_HANDLE *phWnd );
  104. STDMETHOD(put_Max)( long lMax );
  105. STDMETHOD(get_Max)( long *plMax );
  106. STDMETHOD(put_Min)( long lMin );
  107. STDMETHOD(get_Min)( long *plMin );
  108. STDMETHOD(put_Value)( long lValue );
  109. STDMETHOD(get_Value)( long *plValue );
  110. // DRstrProgressEvents firing methods
  111. public:
  112. STDMETHOD(Fire_OnCreate)();
  113. // Properties
  114. protected:
  115. // Operations
  116. protected:
  117. };
  118. #endif //_RSTRPROG_H__INCLUDED_