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.

90 lines
2.3 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: ieeventhandler.h
  4. //
  5. // Synopsis: This file holds the declarations and implementation of the
  6. // CWebBrowserEventSink class
  7. //
  8. // History: 11/10/2000 serdarun Created
  9. //
  10. // Copyright (C) 1999-2000 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //#--------------------------------------------------------------
  14. #ifndef _IEEVENTHANDLER_H_
  15. #define _IEEVENTHANDLER_H_
  16. class CMainWindow;
  17. //
  18. // This class implements DIID_DWebBrowserEvents2 interface through
  19. // IDispatch to retrieve the events from IE control
  20. //
  21. class ATL_NO_VTABLE CWebBrowserEventSink :
  22. public CComObjectRootEx<CComSingleThreadModel>,
  23. public IDispatch
  24. {
  25. BEGIN_COM_MAP(CWebBrowserEventSink)
  26. COM_INTERFACE_ENTRY(IDispatch)
  27. COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, IDispatch)
  28. END_COM_MAP()
  29. public:
  30. //
  31. //Constructor for CWebBrowserEventSink
  32. //Initialize the member variables
  33. //
  34. CWebBrowserEventSink()
  35. :m_pMainWindow(NULL),
  36. m_bMainControl(true)
  37. {
  38. }
  39. //
  40. //None of the IDispatch methods are used, except Invoke
  41. //
  42. STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)
  43. {
  44. return E_NOTIMPL;
  45. }
  46. //
  47. //None of the IDispatch methods are used, except Invoke
  48. //
  49. STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
  50. {
  51. return E_NOTIMPL;
  52. }
  53. //
  54. //None of the IDispatch methods are used, except Invoke
  55. //
  56. STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid)
  57. {
  58. return E_NOTIMPL;
  59. }
  60. //
  61. //Notify the main
  62. //
  63. STDMETHOD(Invoke)(DISPID dispid, REFIID riid, LCID lcid,
  64. WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
  65. EXCEPINFO* pexcepinfo, UINT* puArgErr);
  66. public:
  67. //
  68. //pointer to main window to notify the window about IE control events
  69. //
  70. CMainWindow* m_pMainWindow;
  71. //
  72. //variable to distinguish event sinks for main IE control and secondary
  73. //one that is used to render startup and shutdown bitmaps
  74. //
  75. bool m_bMainControl;
  76. };
  77. #endif //_IEEVENTHANDLER_H_