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.

102 lines
3.3 KiB

  1. // IEInstallCtrl.h : Declaration of the CIEInstallCtrl
  2. #ifndef __IEINSTALLCTRL_H_
  3. #define __IEINSTALLCTRL_H_
  4. #include "resource.h" // main symbols
  5. #include <mshtml.h>
  6. #include <wininet.h>
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CIEInstallCtrl
  9. class ATL_NO_VTABLE CIEInstallCtrl :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public CComCoClass<CIEInstallCtrl,&CLSID_IEInstallCtrl>,
  12. public CComControl<CIEInstallCtrl>,
  13. public IDispatchImpl<IIEInstallCtrl, &IID_IIEInstallCtrl, &LIBID_IEINSTLib>,
  14. public IPersistStreamInitImpl<CIEInstallCtrl>,
  15. public IOleControlImpl<CIEInstallCtrl>,
  16. public IOleObjectImpl<CIEInstallCtrl>,
  17. public IOleInPlaceActiveObjectImpl<CIEInstallCtrl>,
  18. public IViewObjectExImpl<CIEInstallCtrl>,
  19. public IOleInPlaceObjectWindowlessImpl<CIEInstallCtrl>,
  20. public IObjectSafetyImpl<CIEInstallCtrl>
  21. {
  22. public:
  23. CIEInstallCtrl()
  24. {
  25. }
  26. DECLARE_REGISTRY_RESOURCEID(IDR_IEINSTALLCTRL)
  27. BEGIN_COM_MAP(CIEInstallCtrl)
  28. COM_INTERFACE_ENTRY(IDispatch)
  29. COM_INTERFACE_ENTRY(IIEInstallCtrl)
  30. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
  31. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
  32. COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
  33. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
  34. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
  35. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
  36. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
  37. COM_INTERFACE_ENTRY_IMPL(IOleControl)
  38. COM_INTERFACE_ENTRY_IMPL(IOleObject)
  39. COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
  40. COM_INTERFACE_ENTRY_IMPL(IObjectSafety)
  41. END_COM_MAP()
  42. BEGIN_PROPERTY_MAP(CIEInstallCtrl)
  43. // Example entries
  44. // PROP_ENTRY("Property Description", dispid, clsid)
  45. // PROP_PAGE(CLSID_StockColorPage)
  46. END_PROPERTY_MAP()
  47. BEGIN_MSG_MAP(CIEInstallCtrl)
  48. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  49. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  50. MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
  51. END_MSG_MAP()
  52. // IViewObjectEx
  53. STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
  54. {
  55. ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n"));
  56. *pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE;
  57. return S_OK;
  58. }
  59. // IObjectSafety
  60. STDMETHOD(GetInterfaceSafetyOptions)(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
  61. {
  62. ATLTRACE(_T("IObjectSafetyImpl::GetInterfaceSafetyOptions\n"));
  63. if (pdwSupportedOptions == NULL || pdwEnabledOptions == NULL)
  64. return E_POINTER;
  65. HRESULT hr = S_OK;
  66. if (riid == IID_IDispatch)
  67. {
  68. *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
  69. *pdwEnabledOptions = m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_CALLER;
  70. }
  71. else
  72. {
  73. *pdwSupportedOptions = 0;
  74. *pdwEnabledOptions = 0;
  75. hr = E_NOINTERFACE;
  76. }
  77. return hr;
  78. }
  79. STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions);
  80. // IIEInstallCtrl
  81. public:
  82. HRESULT OnDraw(ATL_DRAWINFO& di);
  83. STDMETHOD(Insert)(BSTR Header, BSTR Name, BSTR Value, BSTR InsFilename, long *lRet);
  84. STDMETHOD(WorkingDir)(BSTR bstrPath, BSTR *bstrDir);
  85. };
  86. #endif //__IEINSTALLCTRL_H_