Source code of Windows XP (NT5)
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.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: webctrl.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // WebCtrl.h : header file
  11. //
  12. #ifndef __WEBCTRL_H__
  13. #define __WEBCTRL_H__
  14. #include "ocxview.h"
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CAMCWebViewCtrl window
  17. class CAMCWebViewCtrl : public COCXHostView
  18. {
  19. public:
  20. typedef COCXHostView BaseClass;
  21. enum
  22. {
  23. WS_HISTORY = 0x00000001, // integrate with history
  24. WS_SINKEVENTS = 0x00000002, // act as sink for DIID_DWebBrowserEvents
  25. };
  26. // Construction
  27. public:
  28. CAMCWebViewCtrl();
  29. DECLARE_DYNCREATE(CAMCWebViewCtrl)
  30. // attributes
  31. private:
  32. CMMCAxWindow m_wndAx; // This ActiveX control will host the web browser.
  33. IWebBrowser2Ptr m_spWebBrowser2; // the interface implemented by the web browser.
  34. DWORD m_dwAdviseCookie; // the connection ID established by the web browser with the event sink.
  35. CComPtr<IWebSink> m_spWebSink;
  36. protected:
  37. virtual CMMCAxWindow * GetAxWindow() {return &m_wndAx;}
  38. private:
  39. SC ScCreateWebBrowser();
  40. bool IsHistoryEnabled() const;
  41. bool IsSinkEventsEnabled() const;
  42. // Operations
  43. public:
  44. void Navigate(LPCTSTR lpszWebSite, LPCTSTR lpszFrameTarget);
  45. void Back();
  46. void Forward();
  47. void Refresh();
  48. void Stop();
  49. LPUNKNOWN GetIUnknown(void);
  50. SC ScGetReadyState(READYSTATE& state);
  51. // Overrides
  52. // ClassWizard generated virtual function overrides
  53. //{{AFX_VIRTUAL(CAMCWebViewCtrl)
  54. public:
  55. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. public:
  59. virtual ~CAMCWebViewCtrl();
  60. // Generated message map functions
  61. protected:
  62. //{{AFX_MSG(CAMCWebViewCtrl)
  63. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  64. afx_msg void OnDestroy();
  65. //}}AFX_MSG
  66. DECLARE_MESSAGE_MAP()
  67. };
  68. /////////////////////////////////////////////////////////////////////////////
  69. #include "webctrl.inl"
  70. #endif //__WEBCTRL_H__