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.

114 lines
4.7 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // MSOBWEB.H - Header for the implementation of CObWebBrowser
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. //
  12. // Class which will call up an IOleSite and the WebOC
  13. // and provide external interfaces.
  14. #ifndef _MSOBWEB_H_
  15. #define _MSOBWEB_H_
  16. #include <exdisp.h>
  17. #include <oleauto.h>
  18. #include "cunknown.h"
  19. #include "obweb.h"
  20. #include "iosite.h"
  21. #include "wmp.h"
  22. class CObWebBrowser : public CUnknown,
  23. public IObWebBrowser,
  24. public IDispatch
  25. {
  26. // Declare the delegating IUnknown.
  27. DECLARE_IUNKNOWN
  28. public:
  29. static HRESULT CreateInstance (IUnknown* pOuterUnknown, CUnknown** ppNewComponent);
  30. // IObWebBrowser Members
  31. virtual HRESULT __stdcall AttachToWindow (HWND hWnd);
  32. virtual HRESULT __stdcall PreTranslateMessage (LPMSG lpMsg);
  33. virtual HRESULT __stdcall Navigate (WCHAR* pszUrl, WCHAR* pszTarget);
  34. virtual HRESULT __stdcall ListenToWebBrowserEvents (IUnknown* pUnk);
  35. virtual HRESULT __stdcall StopListeningToWebBrowserEvents (IUnknown* pUnk);
  36. virtual HRESULT __stdcall get_WebBrowserDoc (IDispatch** ppDisp);
  37. virtual HRESULT __stdcall ObWebShowWindow ();
  38. virtual HRESULT __stdcall SetExternalInterface (IUnknown* pUnk);
  39. virtual HRESULT __stdcall Stop();
  40. STDMETHOD (PlayBackgroundMusic) ();
  41. STDMETHOD (StopBackgroundMusic) ();
  42. STDMETHOD (UnhookScriptErrorHandler) ();
  43. // IDispatch Members
  44. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  45. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  46. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT,
  47. LCID, DISPID* );
  48. STDMETHOD (Invoke) (DISPID dispidMember,
  49. REFIID riid,
  50. LCID lcid,
  51. WORD wFlags,
  52. DISPPARAMS* pdispparams,
  53. VARIANT* pvarResult,
  54. EXCEPINFO* pexcepinfo,
  55. UINT* puArgErr);
  56. private:
  57. HWND m_hMainWnd;
  58. COleSite* m_pOleSite;
  59. LPOLEOBJECT m_lpOleObject;
  60. IWebBrowser2* m_lpWebBrowser;
  61. DWORD m_dwcpCookie;
  62. DWORD m_dwDrawAspect;
  63. BOOL m_fInPlaceActive;
  64. // Script error reporting stuff
  65. BOOL m_fOnErrorWasHooked;
  66. // Need a convenient place to have a WMP control
  67. COleSite* m_pOleSiteWMP;
  68. LPOLEOBJECT m_lpOleObjectWMP;
  69. IWMPPlayer* m_pWMPPlayer;
  70. // IUnknown
  71. virtual HRESULT __stdcall NondelegatingQueryInterface( const IID& iid, void** ppv);
  72. CObWebBrowser (IUnknown* pOuterUnknown);
  73. virtual ~CObWebBrowser ();
  74. virtual void FinalRelease (); // Notify derived classes that we are releasing
  75. void InitBrowserObject ();
  76. void InPlaceActivate ();
  77. void UIActivate ();
  78. void CloseOleObject ();
  79. void UnloadOleObject ();
  80. HRESULT ConnectToConnectionPoint (IUnknown* punkThis,
  81. REFIID riidEvent,
  82. BOOL fConnect,
  83. IUnknown* punkTarget,
  84. DWORD* pdwCookie,
  85. IConnectionPoint** ppcpOut);
  86. STDMETHOD(onerror) (IN VARIANT* pvarMsg,
  87. IN VARIANT* pvarUrl,
  88. IN VARIANT* pvarLine,
  89. OUT VARIANT_BOOL* pfResult);
  90. };
  91. #define SETDefFormatEtc(fe, cf, med) \
  92. {\
  93. (fe).cfFormat=cf;\
  94. (fe).dwAspect=DVASPECT_CONTENT;\
  95. (fe).ptd=NULL;\
  96. (fe).tymed=med;\
  97. (fe).lindex=-1;\
  98. };
  99. #endif